Better feedback when starting server

This commit is contained in:
Imbus 2024-02-12 17:20:42 +01:00
parent 374e89d1ac
commit 5d8d5c6fde

View file

@ -16,7 +16,6 @@ func handler(w http.ResponseWriter, r *http.Request) {
} }
func main() { func main() {
println("Starting server...")
database.DbConnect() database.DbConnect()
// Mounting the handler // Mounting the handler
@ -25,6 +24,9 @@ func main() {
http.HandleFunc("/hello", handler) http.HandleFunc("/hello", handler)
// Start the server on port 8080 // Start the server on port 8080
println("Currently listening on http://localhost:8080")
println("Visit http://localhost:8080/hello to see the handler in action")
printlm("Press Ctrl+C to stop the server")
err := http.ListenAndServe(":8080", nil) err := http.ListenAndServe(":8080", nil)
if err != nil { if err != nil {
panic(err) panic(err)