I am working on a CMS project where the URL for the frontend is https://cms.example.com
However, the backend routes start with /v1
which I have configured in gin as a Router Group engine.Group("/v1")
. Hence a backend endpoint will be something like https://cms.example.com/v1/endpoint
I've also set a NoRoute
handler function:
var errRouteNotFound = errors.New("route not found")
s.engine.NoRoute(func(c *gin.Context) {
c.AbortWithError(http.StatusNotFound, errRouteNotFound)
})
The issue I am facing is that whenever someone visits the frontend, I get a 404 error for GET request on /
in the backend logs. How can I avoid getting these logs without changing the route schema as it's part of a bigger project?
Edit: I am using a custom logger.