remove flask mentions

This commit is contained in:
nahakubuilde
2025-08-25 08:55:21 +01:00
parent bfa0eaf68a
commit 17d8e8144b
2 changed files with 12 additions and 49 deletions

View File

@@ -11,7 +11,7 @@ import (
)
type Config struct {
// Flask equivalent settings
// SERVER equivalent settings
Host string
Port int
SecretKey string
@@ -32,7 +32,7 @@ type Config struct {
}
var defaultConfig = map[string]map[string]string{
"FLASK": {
"SERVER": {
"HOST": "0.0.0.0",
"PORT": "3000",
"SECRET_KEY": "change-this-secret-key",
@@ -69,13 +69,13 @@ func Load() (*Config, error) {
config := &Config{}
// Load FLASK section
flaskSection := cfg.Section("FLASK")
config.Host = flaskSection.Key("HOST").String()
config.Port, _ = flaskSection.Key("PORT").Int()
config.SecretKey = flaskSection.Key("SECRET_KEY").String()
config.Debug, _ = flaskSection.Key("DEBUG").Bool()
maxContentMB, _ := flaskSection.Key("MAX_CONTENT_LENGTH").Int()
// Load SERVER section
SERVERSection := cfg.Section("SERVER")
config.Host = SERVERSection.Key("HOST").String()
config.Port, _ = SERVERSection.Key("PORT").Int()
config.SecretKey = SERVERSection.Key("SECRET_KEY").String()
config.Debug, _ = SERVERSection.Key("DEBUG").Bool()
maxContentMB, _ := SERVERSection.Key("MAX_CONTENT_LENGTH").Int()
config.MaxContentLength = int64(maxContentMB) * 1024 * 1024 // Convert MB to bytes
// Load MD_NOTES_APP section
@@ -190,7 +190,7 @@ func (c *Config) SaveSetting(section, key, value string) error {
// Update in-memory config based on section and key
switch section {
case "FLASK":
case "SERVER":
switch key {
case "HOST":
c.Host = value