From 80907a89a945655a778a734ce2c4d3640ba6c3d2 Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Mon, 14 Jul 2025 21:58:01 -0500 Subject: [PATCH] refactor(backend): changes to how the api incorrect routes are handled --- backend/main.go | 6 +++++- package-lock.json | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/main.go b/backend/main.go index 59c869e..ee6be46 100644 --- a/backend/main.go +++ b/backend/main.go @@ -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"}) } diff --git a/package-lock.json b/package-lock.json index 9338ab1..ee7cfe8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "logistics_support_tool", - "version": "0.0.3-alpha.22", + "version": "0.0.1-alpha.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "logistics_support_tool", - "version": "0.0.3-alpha.22", + "version": "0.0.1-alpha.1", "license": "ISC", "dependencies": { "dotenv": "^17.2.0",