summaryrefslogtreecommitdiffstats
path: root/api/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/api.go')
-rw-r--r--api/api.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/api/api.go b/api/api.go
index 7e902c159..814341003 100644
--- a/api/api.go
+++ b/api/api.go
@@ -60,14 +60,14 @@ type Routes struct {
var BaseRoutes *Routes
func InitRouter() {
- app.Srv.Router = mux.NewRouter()
- app.Srv.Router.NotFoundHandler = http.HandlerFunc(Handle404)
+ app.Global().Srv.Router = mux.NewRouter()
+ app.Global().Srv.Router.NotFoundHandler = http.HandlerFunc(Handle404)
}
func InitApi() {
BaseRoutes = &Routes{}
- BaseRoutes.Root = app.Srv.Router
- BaseRoutes.ApiRoot = app.Srv.Router.PathPrefix(model.API_URL_SUFFIX_V3).Subrouter()
+ BaseRoutes.Root = app.Global().Srv.Router
+ BaseRoutes.ApiRoot = app.Global().Srv.Router.PathPrefix(model.API_URL_SUFFIX_V3).Subrouter()
BaseRoutes.Users = BaseRoutes.ApiRoot.PathPrefix("/users").Subrouter()
BaseRoutes.NeedUser = BaseRoutes.Users.PathPrefix("/{user_id:[A-Za-z0-9]+}").Subrouter()
BaseRoutes.Teams = BaseRoutes.ApiRoot.PathPrefix("/teams").Subrouter()
@@ -111,7 +111,7 @@ func InitApi() {
InitDeprecated()
// 404 on any api route before web.go has a chance to serve it
- app.Srv.Router.Handle("/api/{anything:.*}", http.HandlerFunc(Handle404))
+ app.Global().Srv.Router.Handle("/api/{anything:.*}", http.HandlerFunc(Handle404))
utils.InitHTML()