databag/net/server/internal/getNodeConfig_endpoint.go

25 lines
532 B
Go
Raw Normal View History

2022-01-15 21:45:37 +00:00
package databag
import (
"net/http"
)
func GetNodeConfig(w http.ResponseWriter, r *http.Request) {
// validate login
if !adminLogin(r) {
2022-01-16 07:25:43 +00:00
LogMsg("SetNodeConfig - invalid admin credentials");
2022-01-15 21:45:37 +00:00
w.WriteHeader(http.StatusUnauthorized);
return
}
// get node config fields
var config NodeConfig;
config.Domain = getStrConfigValue(CONFIG_DOMAIN, "");
config.PublicLimit = getNumConfigValue(CONFIG_PUBLICLIMIT, 0);
config.AccountStorage = getNumConfigValue(CONFIG_STORAGE, 0);
2022-01-16 07:25:43 +00:00
WriteResponse(w, config);
2022-01-15 21:45:37 +00:00
}