Reformat http

This commit is contained in:
Jan Bader 2016-12-20 09:46:39 +01:00
parent 308ff98830
commit 0f1bd4cac3

View File

@ -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")