Skip to content

Commit

Permalink
added base url path
Browse files Browse the repository at this point in the history
  • Loading branch information
somnathbm committed Dec 17, 2024
1 parent 38fbefd commit 32e32e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit 32e32e0

Please sign in to comment.