0
Fork 0
mirror of https://codeberg.org/SafeTwitch/safetwitch-backend.git synced 2024-12-22 13:13:00 -05:00
safetwitch-backend/main.go
2023-05-18 10:17:08 -04:00

26 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()
}