This commit is contained in:
Odweta
2026-03-19 10:32:41 +01:00
parent 12def174a4
commit 868594bc3a
6 changed files with 43 additions and 6 deletions
+7 -1
View File
@@ -4,6 +4,7 @@ package main
import (
"net/http"
"os"
"github.com/go-chi/chi/v5"
)
@@ -17,7 +18,12 @@ func main() {
r.Get("/users", getUsers)
r.Post("/users", createUser)
http.ListenAndServe(":8080", r)
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
http.ListenAndServe(":"+port, r)
}
/*package main