diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/api.go | 1 | ||||
-rw-r--r-- | api/config.go | 23 |
2 files changed, 24 insertions, 0 deletions
diff --git a/api/api.go b/api/api.go index 2ea27ed9f..9770930f7 100644 --- a/api/api.go +++ b/api/api.go @@ -40,6 +40,7 @@ func InitApi() { InitWebSocket(r) InitFile(r) InitCommand(r) + InitConfig(r) templatesDir := utils.FindDir("api/templates") l4g.Debug("Parsing server templates at %v", templatesDir) diff --git a/api/config.go b/api/config.go new file mode 100644 index 000000000..91097b4a1 --- /dev/null +++ b/api/config.go @@ -0,0 +1,23 @@ +// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +// See License.txt for license information. + +package api + +import ( + l4g "code.google.com/p/log4go" + "github.com/gorilla/mux" + "github.com/mattermost/platform/utils" + "net/http" + "strconv" +) + +func InitConfig(r *mux.Router) { + l4g.Debug("Initializing config api routes") + + sr := r.PathPrefix("/config").Subrouter() + sr.Handle("/get/bypass_email", ApiAppHandler(getBypassEmail)).Methods("GET") +} + +func getBypassEmail(c *Context, w http.ResponseWriter, r *http.Request) { + w.Write([]byte(strconv.FormatBool(utils.Cfg.EmailSettings.ByPassEmail))) +} |