Better feedback when starting server
This commit is contained in:
parent
374e89d1ac
commit
5d8d5c6fde
1 changed files with 3 additions and 1 deletions
|
@ -16,7 +16,6 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
func main() {
|
||||
println("Starting server...")
|
||||
database.DbConnect()
|
||||
|
||||
// Mounting the handler
|
||||
|
@ -25,6 +24,9 @@ func main() {
|
|||
http.HandleFunc("/hello", handler)
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
Loading…
Reference in a new issue