aboutsummaryrefslogtreecommitdiff
path: root/backend/routes
diff options
context:
space:
mode:
Diffstat (limited to 'backend/routes')
-rw-r--r--backend/routes/routes.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/backend/routes/routes.go b/backend/routes/routes.go
new file mode 100644
index 0000000..5607252
--- /dev/null
+++ b/backend/routes/routes.go
@@ -0,0 +1,16 @@
1package routes
2
3import (
4 "github.com/gin-contrib/sessions"
5 "github.com/gin-contrib/sessions/cookie"
6 "github.com/gin-gonic/gin"
7 "github.com/pektezol/leastportals/backend/controllers"
8)
9
10func InitRoutes(router *gin.Engine) {
11 store := cookie.NewStore([]byte(controllers.GetEnvKey("SESSION_KEY")))
12 router.Use(sessions.Sessions("session", store))
13 router.GET("/", controllers.Home)
14 router.GET("/login", controllers.Login)
15 router.GET("/logout", controllers.Logout)
16}