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