refactor(backend): changes to how the api incorrect routes are handled

This commit is contained in:
2025-07-14 21:58:01 -05:00
parent 2472374157
commit 80907a89a9
2 changed files with 7 additions and 3 deletions

View File

@@ -16,10 +16,14 @@ func main() {
c.JSON(200, gin.H{"message": "pong"})
})
r.Any("/api", errorApiLoc)
r.Any("/", errorLoc)
r.Run(":8080")
}
func errorLoc(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"message": "welcome to lst system you might have just encountered an incorrect area of the app"})
c.JSON(http.StatusBadRequest, gin.H{"message": "welcome to lst system you might have just encountered an incorrect area of the app"})
}
func errorApiLoc(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"message": "looks like you have encountered an api route that dose not exist"})
}