feat: accept host variable

This commit is contained in:
2025-05-21 19:26:14 +02:00
parent afc9208269
commit a8e75d75f0
2 changed files with 8 additions and 1 deletions

View File

@ -32,12 +32,17 @@ func main() {
user.EnsureAdminUser(ctx, repo)
host := os.Getenv("HOST")
if host == "" {
host = "0.0.0.0"
}
port := os.Getenv("PORT")
if port == "" {
port = "3000"
}
server := api.NewAPIServer(fmt.Sprintf(":%s", port), repo)
server := api.NewAPIServer(fmt.Sprintf("127.0.0.1:%s", port), repo)
if err := server.Run(); err != nil {
log.Fatalln("ERR: Failed to start server:", err)
}