🎨 set up routes

This commit is contained in:
landaiqing
2024-08-04 13:11:54 +08:00
parent 3dac34d307
commit f4b69b5d31
8 changed files with 137 additions and 6 deletions

View File

@@ -13,14 +13,13 @@ import (
func InitConfig() {
const ConfigFile = "config.yaml"
c := &config.Config{}
yamlCOnf, err := os.ReadFile(ConfigFile)
yamlConf, err := os.ReadFile(ConfigFile)
if err != nil {
panic(fmt.Errorf("get yaml config error: %s", err))
}
err = yaml.Unmarshal(yamlCOnf, c)
err = yaml.Unmarshal(yamlConf, c)
if err != nil {
log.Fatal("config init unmarshal error: ", err)
}
log.Println("config init success")
global.CONFIG = c
}