fix: add default port
This commit is contained in:
parent
022e5f6c62
commit
5c10dc7684
1 changed files with 7 additions and 2 deletions
|
|
@ -33,6 +33,11 @@ func NewRouter() {
|
||||||
|
|
||||||
r.Get("/currently-playing", handler.HandleGetCurrentlyPlaying)
|
r.Get("/currently-playing", handler.HandleGetCurrentlyPlaying)
|
||||||
|
|
||||||
slog.Info("Starting server", slog.Any("port", os.Getenv("PORT")))
|
port := os.Getenv("PORT")
|
||||||
http.ListenAndServe(":"+os.Getenv("PORT"), r)
|
if len(port) == 0 {
|
||||||
|
port = "8080"
|
||||||
|
}
|
||||||
|
|
||||||
|
slog.Info("Starting server", slog.Any("port", port))
|
||||||
|
http.ListenAndServe(":"+port, r)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue