From 32e32e04de4a73a6f3d2b9f480943507335d61b8 Mon Sep 17 00:00:00 2001 From: somnath Date: Tue, 17 Dec 2024 21:35:27 +0530 Subject: [PATCH] added base url path --- src/api/api.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/api.go b/src/api/api.go index 730d4a9..a93d4b6 100644 --- a/src/api/api.go +++ b/src/api/api.go @@ -17,14 +17,14 @@ func RunAppServer(appMonitor *ginmetrics.Monitor) *gin.Engine { appRouter := gin.Default() // for service liveness check - appRouter.GET("/healthy", func(c *gin.Context) { + appRouter.GET("/pm/healthy", func(c *gin.Context) { c.JSON(http.StatusOK, gin.H{ "status": "healthy!", }) }) // get all patients - appRouter.GET("/patients", func(c *gin.Context) { + appRouter.GET("/pm/patients", func(c *gin.Context) { result, err := db.GetAllPatients() if err != nil { c.JSON(http.StatusBadRequest, gin.H{ @@ -42,7 +42,7 @@ func RunAppServer(appMonitor *ginmetrics.Monitor) *gin.Engine { }) // patient lookup using phone number - appRouter.GET("/patients/:phone", func(c *gin.Context) { + appRouter.GET("/pm/patients/:phone", func(c *gin.Context) { phone_num := c.Param("phone") result, err := db.GetPatientInfoByPhone(phone_num) if err != nil { @@ -58,7 +58,7 @@ func RunAppServer(appMonitor *ginmetrics.Monitor) *gin.Engine { return }) - appRouter.POST("/patients", func(c *gin.Context) { + appRouter.POST("/pm/patients", func(c *gin.Context) { var patientData models.PatientInfo // ↴ this validates the payload