CI/CD
This commit is contained in:
+7
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user