1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-08 04:21:57 +00:00

create the new FileServer and HandleDir, deprecate the rest APIBuilder/Party static methods and more

relative: https://github.com/kataras/iris/issues/1283 and removing pongo2 from vendor: https://github.com/kataras/iris/issues/1284

Former-commit-id: 3ec57b349f99faca2b8e36d9f7252db0b6ea080d
This commit is contained in:
Gerasimos (Makis) Maropoulos
2019-06-21 19:43:25 +03:00
parent 7f9e33cabb
commit d0104defa8
72 changed files with 1585 additions and 1826 deletions

View File

@@ -76,11 +76,14 @@ func NewDefaultHandler() RequestHandler {
type RoutesProvider interface { // api builder
GetRoutes() []*Route
GetRoute(routeName string) *Route
// GetStaticSites() []*StaticSite
// Macros() *macro.Macros
}
func (h *routerHandler) Build(provider RoutesProvider) error {
registeredRoutes := provider.GetRoutes()
h.trees = h.trees[0:0] // reset, inneed when rebuilding.
rp := errors.NewReporter()
registeredRoutes := provider.GetRoutes()
// sort, subdomains go first.
sort.Slice(registeredRoutes, func(i, j int) bool {
@@ -111,11 +114,8 @@ func (h *routerHandler) Build(provider RoutesProvider) error {
// the rest are handled inside the node
return lsub1 > lsub2
})
rp := errors.NewReporter()
for _, r := range registeredRoutes {
// build the r.Handlers based on begin and done handlers, if any.
r.BuildHandlers()
@@ -133,6 +133,7 @@ func (h *routerHandler) Build(provider RoutesProvider) error {
rp.Add("%v -> %s", err, r.String())
continue
}
golog.Debugf(r.Trace())
}