Skip to content

Commit

Permalink
fix: gin main now handles server error
Browse files Browse the repository at this point in the history
  • Loading branch information
abdahmed22 committed Jul 8, 2024
1 parent 9bfae07 commit 16e21b3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/ginserver/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import (
"log"

"github.com/codescalersinternships/DateTime-Server-Abdelrahman-Mahmoud/pkg/ginserver"
"github.com/gin-gonic/gin"
)
Expand All @@ -9,5 +11,9 @@ func main() {
r := gin.Default()
r.GET("/datetime", ginserver.GetDateTimeHandler)

r.Run()
err := r.Run()

if err != nil {
log.Fatalf("HTTP server error: %v", err)
}
}

0 comments on commit 16e21b3

Please sign in to comment.