Files
gocryptotrader/configRoutes.go
Scott e85876e273 Enhances configuration page
Adds Notification angular module
Adds Requestify for ExpressJS to make posting ezpz
Now can post data to gocryptoCore
GoCrypto can now receive data on settings save
2016-08-08 14:52:25 +10:00

41 lines
724 B
Go

package main
import (
"encoding/json"
"net/http"
)
func getAllSettings(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
w.WriteHeader(http.StatusOK)
if err := json.NewEncoder(w).Encode(bot.config); err != nil {
panic(err)
}
}
func saveAllSettings(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
w.WriteHeader(http.StatusOK)
if err := json.NewEncoder(w).Encode(true); err != nil {
panic(err)
}
}
var configRoutes = Routes{
Route{
"GetAllSettings",
"GET",
"/config/all",
getAllSettings,
},
Route{
"SaveAllSettings",
"POST",
"/config/all/save",
saveAllSettings,
},
}