databag/net/server/internal/api_getNodeConfig.go

24 lines
498 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
2022-01-19 20:07:57 +00:00
if err := AdminLogin(r); err != nil {
ErrResponse(w, http.StatusUnauthorized, err)
2022-01-15 21:45:37 +00:00
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
}