mirror of
https://codeberg.org/SafeTwitch/safetwitch-backend.git
synced 2024-12-22 05:02:58 -05:00
27 lines
426 B
Go
27 lines
426 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"safetwitch-backend/routes"
|
||
|
|
||
|
"strings"
|
||
|
|
||
|
"github.com/gin-gonic/gin"
|
||
|
)
|
||
|
|
||
|
func notFoundHandler(context *gin.Context) {
|
||
|
message := []string{"path", context.Request.URL.Path, "was not found."}
|
||
|
|
||
|
context.JSON(404, gin.H{
|
||
|
"status": "error",
|
||
|
"message": strings.Join(message, " "),
|
||
|
})
|
||
|
}
|
||
|
|
||
|
func main() {
|
||
|
router := gin.Default()
|
||
|
routes.SetRoutes(router)
|
||
|
|
||
|
router.NoRoute(notFoundHandler)
|
||
|
router.Run()
|
||
|
}
|