Reformat http
This commit is contained in:
parent
308ff98830
commit
0f1bd4cac3
13
http/http.go
13
http/http.go
@ -20,6 +20,7 @@ const (
|
||||
authCookie = "authentication"
|
||||
)
|
||||
|
||||
// Serve starts the HTTP Server
|
||||
func (h *Handler) Serve() {
|
||||
router := gin.Default()
|
||||
|
||||
@ -31,18 +32,12 @@ func (h *Handler) Serve() {
|
||||
api := router.Group("/api/v1")
|
||||
{
|
||||
api.GET("/logout", logout)
|
||||
api.GET("/login", func(c *gin.Context) {
|
||||
c.Redirect(http.StatusPermanentRedirect, "/login")
|
||||
})
|
||||
api.GET("/login", func(c *gin.Context) { c.Redirect(http.StatusPermanentRedirect, "/login") })
|
||||
api.POST("/login", h.loginPost)
|
||||
|
||||
// Unauthenticated routes
|
||||
api.GET("/check", func(c *gin.Context) {
|
||||
c.String(http.StatusOK, "Accessible")
|
||||
})
|
||||
api.GET("/hello", func(c *gin.Context) {
|
||||
c.String(http.StatusOK, "Hello, World!")
|
||||
})
|
||||
api.GET("/check", func(c *gin.Context) { c.String(http.StatusOK, "Accessible") })
|
||||
api.GET("/hello", func(c *gin.Context) { c.String(http.StatusOK, "Hello, World!") })
|
||||
|
||||
// Restricted group
|
||||
r := api.Group("/restricted")
|
||||
|
Loading…
x
Reference in New Issue
Block a user