diff options
author | Corey Hulen <corey@hulen.com> | 2016-05-24 14:31:30 -0700 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-05-24 14:31:30 -0700 |
commit | 09863c0b80610f2f3a35cf3caa7c5b66a0c3878e (patch) | |
tree | dcce1b5c0fa62a9da2b25a99862af5ba30306901 /api/api.go | |
parent | 4ae7128ecb66cdddeb9d40a24970c6552814c18b (diff) | |
download | chat-09863c0b80610f2f3a35cf3caa7c5b66a0c3878e.tar.gz chat-09863c0b80610f2f3a35cf3caa7c5b66a0c3878e.tar.bz2 chat-09863c0b80610f2f3a35cf3caa7c5b66a0c3878e.zip |
Adding APIs to reload config, recycle db connections and ping server (#3096)
* Adding APIs to reload config, recycle db connections and ping server
* Fixing unit test
* Adding unit tests
Diffstat (limited to 'api/api.go')
-rw-r--r-- | api/api.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/api/api.go b/api/api.go index 6626ef326..e62d34dcc 100644 --- a/api/api.go +++ b/api/api.go @@ -40,6 +40,8 @@ type Routes struct { Admin *mux.Router // 'api/v3/admin' + General *mux.Router // 'api/v3/general' + Preferences *mux.Router // 'api/v3/preferences' License *mux.Router // 'api/v3/license' @@ -67,6 +69,7 @@ func InitApi() { BaseRoutes.Hooks = BaseRoutes.NeedTeam.PathPrefix("/hooks").Subrouter() BaseRoutes.OAuth = BaseRoutes.ApiRoot.PathPrefix("/oauth").Subrouter() BaseRoutes.Admin = BaseRoutes.ApiRoot.PathPrefix("/admin").Subrouter() + BaseRoutes.General = BaseRoutes.ApiRoot.PathPrefix("/general").Subrouter() BaseRoutes.Preferences = BaseRoutes.ApiRoot.PathPrefix("/preferences").Subrouter() BaseRoutes.License = BaseRoutes.ApiRoot.PathPrefix("/license").Subrouter() BaseRoutes.Public = BaseRoutes.ApiRoot.PathPrefix("/public").Subrouter() @@ -79,6 +82,7 @@ func InitApi() { InitFile() InitCommand() InitAdmin() + InitGeneral() InitOAuth() InitWebhook() InitPreference() @@ -100,3 +104,9 @@ func HandleEtag(etag string, w http.ResponseWriter, r *http.Request) bool { return false } + +func ReturnStatusOK(w http.ResponseWriter) { + m := make(map[string]string) + m[model.STATUS] = model.STATUS_OK + w.Write([]byte(model.MapToJson(m))) +} |