Created
September 10, 2019 07:02
-
-
Save kyokomi/28f05540ea4fd3964927282ff619ed8e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gzipGroup := e.Group("", stdMiddleware.Gzip()) | |
authV1API := gzipGroup.Group("/v1", middleware.FirebaseHandler) | |
{ | |
// login | |
authV1API.POST("/login", ctl.PostLogin) | |
// user | |
authV1API.GET("/user/me", ctl.GetUserMe) | |
authV1API.PATCH("/user/me", ctl.PatchUserMe) | |
authV1API.DELETE("/user/me", ctl.DeleteUserMe) | |
// article | |
authV1API.GET("/article/own", ctl.Article.GetOwn) | |
authV1API.POST("/articles", ctl.Article.Creation) | |
authV1API.PATCH("/articles/:id/edit", ctl.Article.Update) | |
authV1API.DELETE("/articles/:id", ctl.Article.Delete) | |
} | |
notAuthV1API := gzipGroup.Group("/v1") | |
{ | |
// user | |
notAuthV1API.GET("/users/:id", ctl.GetOtherUser) | |
// article | |
notAuthV1API.GET("/articles", ctl.Article.GetByCount) | |
notAuthV1API.GET("/articles/:id", ctl.Article.Get) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment