aboutsummaryrefslogtreecommitdiff
path: root/backend/routes
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2022-10-22 19:07:14 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2022-10-22 19:07:14 +0300
commitd963c3f40f075c05d70af32f44ed2bec8e00bc37 (patch)
tree33a362746201ebec46e7c741e40a530d5f32e38b /backend/routes
downloadlphub-d963c3f40f075c05d70af32f44ed2bec8e00bc37.tar.gz
lphub-d963c3f40f075c05d70af32f44ed2bec8e00bc37.tar.bz2
lphub-d963c3f40f075c05d70af32f44ed2bec8e00bc37.zip
init
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}