Skip to content

Commit 62979f5

Browse files
add prefix api for server
1 parent bdc4e0e commit 62979f5

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

main.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,22 @@ func main() {
7979

8080
// CRUD Record
8181
// TODO Filters for records ?
82-
r.GET("/collection/:collection", handlers.ListRecord)
83-
r.GET("/collection/:collection/:id", handlers.GetRecord)
84-
r.POST("/collection/:collection", handlers.CreateRecord)
85-
r.PATCH("/collection/:collection/:id", handlers.UpdateRecord)
86-
r.DELETE("/collection/:collection/:id", handlers.DeleteRecord)
82+
r.GET("/api/collection/:collection", handlers.ListRecord)
83+
r.GET("/api/collection/:collection/:id", handlers.GetRecord)
84+
r.POST("/api/collection/:collection", handlers.CreateRecord)
85+
r.PATCH("/api/collection/:collection/:id", handlers.UpdateRecord)
86+
r.DELETE("/api/collection/:collection/:id", handlers.DeleteRecord)
8787

8888
// CRUD Collection
89-
r.GET("/collections", handlers.ListCollection)
90-
r.GET("/collections/:collection", handlers.GetCollection)
91-
r.POST("/collections/", handlers.CreateCollection)
92-
r.PATCH("/collections/:collection", handlers.UpdateCollection)
93-
r.DELETE("/collections/:collection", handlers.RemoveCollection)
89+
r.GET("/api/collections", handlers.ListCollection)
90+
r.GET("/api/collections/:collection", handlers.GetCollection)
91+
r.POST("/api/collections/", handlers.CreateCollection)
92+
r.PATCH("/api/collections/:collection", handlers.UpdateCollection)
93+
r.DELETE("/api/collections/:collection", handlers.RemoveCollection)
9494

9595
// SuperUser
96-
r.POST("/admin/login", adminHandler)
97-
r.POST("/admin/check", adminCheckHandler)
96+
r.POST("/api/admin/login", adminHandler)
97+
r.POST("/api/admin/check", adminCheckHandler)
9898

9999
// Auth Support
100100
// File Upload

0 commit comments

Comments
 (0)