mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 02:17:05 +00:00
New: gRPC MVC features, new WithLowercaseRouting option and add some new context methods
read HISTORY.md Former-commit-id: 30a16cceb11f754aa32923058abeda1e736350e7
This commit is contained in:
12
iris.go
12
iris.go
@@ -765,18 +765,24 @@ func (app *Application) Build() error {
|
||||
if app.I18n.Loaded() {
|
||||
// {{ tr "lang" "key" arg1 arg2 }}
|
||||
app.view.AddFunc("tr", app.I18n.Tr)
|
||||
app.WrapRouter(app.I18n.Wrapper())
|
||||
app.Router.WrapRouter(app.I18n.Wrapper())
|
||||
}
|
||||
|
||||
if !app.Router.Downgraded() {
|
||||
// router
|
||||
|
||||
if err := app.tryInjectLiveReload(); err != nil {
|
||||
rp.Errf("LiveReload: init: failed: %v", err)
|
||||
}
|
||||
|
||||
if app.config.ForceLowercaseRouting {
|
||||
app.Router.WrapRouter(func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
|
||||
r.URL.Path = strings.ToLower(r.URL.Path)
|
||||
next(w, r)
|
||||
})
|
||||
}
|
||||
|
||||
// create the request handler, the default routing handler
|
||||
routerHandler := router.NewDefaultHandler()
|
||||
routerHandler := router.NewDefaultHandler(app.config)
|
||||
err := app.Router.BuildRouter(app.ContextPool, routerHandler, app.APIBuilder, false)
|
||||
if err != nil {
|
||||
rp.Err(err)
|
||||
|
||||
Reference in New Issue
Block a user