moved api to golang and dashboard do nodejs

This commit is contained in:
RyanBakkes
2022-08-28 10:39:38 +02:00
parent 545cf0cf50
commit b7dcb1afe2
15 changed files with 479 additions and 305 deletions

View File

@@ -0,0 +1,25 @@
package api
import (
"fmt"
"os"
"spekulaas/authentes/database"
"github.com/gin-gonic/gin"
)
func Init(db *database.DatabaseController) {
// set release mode if not in dev env
if os.Getenv("ENV") != "development"{
gin.SetMode(gin.ReleaseMode)
}
// start router
router := gin.Default()
// set ports
Routes(router, db)
// listening at port
router.Run(fmt.Sprintf("%s",os.Getenv("PORT")))
}

View File

@@ -0,0 +1,14 @@
package api
import (
"spekulaas/authentes/database"
"github.com/gin-gonic/gin"
)
func Routes(router *gin.Engine, db *database.DatabaseController){
router.GET("/games")
router.GET("/gameInfo")
router.GET("/gameCards")
router.GET("/gameProgress")
}