Skip to content

Commit 5d55c74

Browse files
committed
main: restapi error handling
if router didnt run throw a message called Server run failed instead crashing
1 parent a539f8e commit 5d55c74

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ func main() {
5555

5656
}
5757

58+
router.Run("localhost:8080")
59+
60+
5861
if err := router.Run(":8080"); err != nil {
5962
log.Fatal("Server Run Failed:")
6063
log.Panic(err)
6164
}
62-
63-
64-
router.Run("localhost:8080")
6565
}
6666

6767
func getProfile(c *gin.Context) {

0 commit comments

Comments
 (0)