Cosmetics
This commit is contained in:
parent
ae0ef08f9b
commit
b30400c288
@ -11,19 +11,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Load .env file
|
|
||||||
err := godotenv.Load()
|
err := godotenv.Load()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Error loading .env file")
|
log.Fatal("Error loading .env file")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Server config
|
|
||||||
port := os.Getenv("SERVER_PORT")
|
port := os.Getenv("SERVER_PORT")
|
||||||
if port == "" {
|
if port == "" {
|
||||||
port = "8080"
|
port = "8080"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start server
|
|
||||||
http.HandleFunc("/", web.Routes)
|
http.HandleFunc("/", web.Routes)
|
||||||
log.Printf("Server running on port %s...", port)
|
log.Printf("Server running on port %s...", port)
|
||||||
err = http.ListenAndServe(":"+port, nil)
|
err = http.ListenAndServe(":"+port, nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user