aboutsummaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-05-05 10:20:41 +0530
committerMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-05-05 10:20:41 +0530
commit499c54e8eb53cf49d8ddae68528eb3a8243101d2 (patch)
treeb0227990ac10376e51423a7886c69e54efa72a29 /server
parent4df6eaa913737427ddec2561c0ee8c9235f0c95f (diff)
fixed broken API routes and css glitch in form
Diffstat (limited to 'server')
-rw-r--r--server/main.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/main.go b/server/main.go
index 49d8c45..8b400fe 100644
--- a/server/main.go
+++ b/server/main.go
@@ -35,13 +35,13 @@ func main() {
items := api.Group("/items")
// items API routes
- items.GET("/", getAllItems)
- items.POST("/", registerItem)
+ items.GET("/get-all", getAllItems)
+ items.POST("/register", registerItem)
// people API routes
- people.GET("/", getAllPeople)
- people.POST("/", registerPerson)
+ people.GET("/get-all", getAllPeople)
+ people.POST("/register", registerPerson)
myRouter.Run(":8080")
}
@@ -75,7 +75,7 @@ func registerItem(ctx *gin.Context) {
// people API functions
func getAllPeople(ctx *gin.Context) {
- ctx.Header("Content-Type", "application/json")
+ // ctx.Header("Content-Type", "application/json")
ctx.JSON(http.StatusOK, db.GetAllPeople())
}