updated to yaml instead of json for config

This commit is contained in:
2025-03-19 01:57:09 +02:00
parent 4b06aae4a3
commit 946bd6018f
2 changed files with 5 additions and 2 deletions

View File

@@ -1,7 +1,6 @@
package main
import (
"encoding/json"
"fmt"
"os"
@@ -11,6 +10,7 @@ import (
"git.acooldomain.co/server-manager/backend/users"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
"gopkg.in/yaml.v3"
)
const CONFIG_PATH = "CONFIG_PATH"
@@ -27,7 +27,7 @@ func main() {
}
var config models.GlobalConfig
err = json.NewDecoder(file).Decode(&config)
err = yaml.NewDecoder(file).Decode(&config)
cors_config.AllowOriginFunc = func(origin string) bool {
return origin[len(origin)-len(config.Domain):] == config.Domain