mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 11:39:17 +00:00
24 lines
498 B
Go
24 lines
498 B
Go
package databag
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
func GetNodeConfig(w http.ResponseWriter, r *http.Request) {
|
|
|
|
// validate login
|
|
if err := AdminLogin(r); err != nil {
|
|
ErrResponse(w, http.StatusUnauthorized, err)
|
|
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);
|
|
|
|
WriteResponse(w, config);
|
|
}
|
|
|