From 0f1bd4cac3ad74f9876f4e631ea5f23c4d945487 Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Tue, 20 Dec 2016 09:46:39 +0100 Subject: [PATCH] Reformat http --- http/http.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/http/http.go b/http/http.go index 6c3792e..3f385e2 100644 --- a/http/http.go +++ b/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")