Skip to content

Commit

Permalink
<fix>: NoRoute
Browse files Browse the repository at this point in the history
  • Loading branch information
HanFengA7 committed Aug 22, 2023
1 parent c1ee6c1 commit 5da2a76
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,13 @@ func InitRouter() {
})
})

router.Run(":8001")
router.NoRoute(func(c *gin.Context) {
c.Redirect(301, "/browseGH/")
})

err := router.Run(":8001")
if err != nil {
return
}

}
Binary file removed main
Binary file not shown.
Binary file removed main.exe
Binary file not shown.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
)

func main() {

model.InitDB()
router.InitRouter()

Expand Down

0 comments on commit 5da2a76

Please sign in to comment.