Add a missing call for fallbackHandler in _examples/routing/fallback-handlers/main.go by @ZaniaDeveloper via PR: #911

Former-commit-id: 94ae5849e16538a4bc7f906c52ed7603c7ae01f6
This commit is contained in:
Gerasimos (Makis) Maropoulos 2018-02-23 15:20:53 +02:00 committed by GitHub
commit d7beb9a752

View File

@ -5,6 +5,9 @@ import "github.com/kataras/iris"
func main() { func main() {
app := iris.New() app := iris.New()
// add a fallback handler to process requests that would not be declared in the router.
app.Fallback(fallbackHandler)
// this works as expected now, // this works as expected now,
// will handle *all* expect DELETE requests, even if there is no routes. // will handle *all* expect DELETE requests, even if there is no routes.
app.Get("/action/{p}", h) app.Get("/action/{p}", h)