From 3f5993eedfd52a0497f7a537601b2d7c9e4d744d Mon Sep 17 00:00:00 2001 From: hmhealey Date: Tue, 11 Aug 2015 14:36:45 -0400 Subject: Added initial api to allow clientside code to query serverside configuration --- api/config.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 api/config.go (limited to 'api/config.go') 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))) +} -- cgit v1.2.3-1-g7c22