package main import ( "backend/core" "backend/server" "backend/util" "strings" ) func main() { cfg, err := util.ReadConfig("config.json") if err != nil { if strings.Compare(err.Error(), "open config.json: no such file or directory") == 0 { util.Logformat(util.INFO, "Creating config file...\n") util.CreateConfig() cfg, err = util.ReadConfig("config.json") } else { util.Logformat(util.ERROR, "Could not read configuration file: %s\n", err.Error()) } } // Reading files util.Logformat(util.INFO, "Reading folder '%s'\n", cfg.PhotoPath) core.ListFiles(cfg.PhotoPath) // Set Log Level util.SetLevel(util.NOLOG) // Rest API start on port server.Start(8085) }