1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-23 21:07:03 +00:00
Former-commit-id: 592e9cddf3511fc08e87f19ad39fdaac479b453f
This commit is contained in:
Frédéric Meyer
2018-02-21 08:18:53 +03:00
parent c0e0886cb9
commit 66209cae4f
6 changed files with 81 additions and 7 deletions

View File

@@ -33,8 +33,9 @@ type tree struct {
}
type routerHandler struct {
trees []*tree
hosts bool // true if at least one route contains a Subdomain.
trees []*tree
hosts bool // true if at least one route contains a Subdomain.
fallbackStack *FallbackStack
}
var _ RequestHandler = &routerHandler{}
@@ -82,6 +83,8 @@ func NewDefaultHandler() RequestHandler {
type RoutesProvider interface { // api builder
GetRoutes() []*Route
GetRoute(routeName string) *Route
FallBackStack() *FallbackStack
}
func (h *routerHandler) Build(provider RoutesProvider) error {
@@ -242,5 +245,5 @@ func (h *routerHandler) HandleRequest(ctx context.Context) {
}
}
ctx.StatusCode(http.StatusNotFound)
ctx.Do(h.fallbackStack.list())
}