Этот коммит содержится в:
=Corey Hulen
2015-09-15 19:09:50 -07:00
родитель b2a679c25d
Коммит 5e2f701e6c
11 изменённых файлов: 6 добавлений и 273 удалений

Просмотреть файл

@@ -42,7 +42,6 @@ func InitApi() {
InitWebSocket(r)
InitFile(r)
InitCommand(r)
InitConfig(r)
InitAdmin(r)
templatesDir := utils.FindDir("api/templates")

Просмотреть файл

@@ -1,34 +0,0 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
// See License.txt for license information.
package api
import (
l4g "code.google.com/p/log4go"
"encoding/json"
"github.com/gorilla/mux"
"github.com/mattermost/platform/model"
"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_all", ApiAppHandler(getConfig)).Methods("GET")
}
func getConfig(c *Context, w http.ResponseWriter, r *http.Request) {
settings := make(map[string]string)
settings["ByPassEmail"] = strconv.FormatBool(utils.Cfg.EmailSettings.ByPassEmail)
if bytes, err := json.Marshal(settings); err != nil {
c.Err = model.NewAppError("getConfig", "Unable to marshall configuration data", err.Error())
return
} else {
w.Write(bytes)
}
}