From ba18374bd1b2644e577247204fad17dd52913b9b Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 7 Feb 2017 08:57:41 -0800 Subject: Implement a few team endpoints for APIv4 (#5296) * Implement GET /teams/{team_id} endpoint for APIv4 * Implement GET /users/{user_id}/teams endpoint for APIv4 * Implement GET /teams/{team_id}/members/{user_id} endpoint for APIv4 --- api4/api.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'api4/api.go') diff --git a/api4/api.go b/api4/api.go index 2293cdec5..5ad410cb3 100644 --- a/api4/api.go +++ b/api4/api.go @@ -94,7 +94,7 @@ func InitApi(full bool) { BaseRoutes.UserByEmail = BaseRoutes.Users.PathPrefix("/email/{email}").Subrouter() BaseRoutes.Teams = BaseRoutes.ApiRoot.PathPrefix("/teams").Subrouter() - BaseRoutes.TeamsForUser = BaseRoutes.Users.PathPrefix("/teams").Subrouter() + BaseRoutes.TeamsForUser = BaseRoutes.User.PathPrefix("/teams").Subrouter() BaseRoutes.Team = BaseRoutes.Teams.PathPrefix("/{team_id:[A-Za-z0-9]+}").Subrouter() BaseRoutes.TeamByName = BaseRoutes.Teams.PathPrefix("/name/{team_name:[A-Za-z0-9_-]+}").Subrouter() BaseRoutes.TeamMembers = BaseRoutes.Team.PathPrefix("/members").Subrouter() @@ -141,11 +141,10 @@ func InitApi(full bool) { InitTeam() InitChannel() + app.Srv.Router.Handle("/api/v4/{anything:.*}", http.HandlerFunc(Handle404)) + // REMOVE CONDITION WHEN APIv3 REMOVED if full { - // 404 on any api route before web.go has a chance to serve it - app.Srv.Router.Handle("/api/{anything:.*}", http.HandlerFunc(Handle404)) - utils.InitHTML() app.InitEmailBatching() -- cgit v1.2.3-1-g7c22