diff --git a/backend/main.go b/backend/main.go index d7713c9..523a6a0 100644 --- a/backend/main.go +++ b/backend/main.go @@ -1,13 +1,14 @@ package main import ( - "encoding/json" "fmt" + "os" _ "ttime/docs" "ttime/internal/config" "ttime/internal/database" "ttime/internal/handlers" + "github.com/BurntSushi/toml" "github.com/gofiber/fiber/v2" "github.com/gofiber/swagger" _ "github.com/mattn/go-sqlite3" @@ -35,9 +36,11 @@ func main() { _ = conf.WriteConfigToFile("config.toml") } - // Pretty print the current config - str, _ := json.MarshalIndent(conf, "", " ") - fmt.Println(string(str)) + // Pretty print the current config with toml + toml.NewEncoder(os.Stdout).Encode(conf) + + fmt.Printf("Starting server on http://localhost:%d\n", conf.Port) + fmt.Printf("For documentation, go to http://localhost:%d/swagger/index.html\n", conf.Port) // Connect to the database db := database.DbConnect(conf.DbPath)