moved api to golang and dashboard do nodejs
This commit is contained in:
25
AuthentesBackend/api/api.go
Normal file
25
AuthentesBackend/api/api.go
Normal 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")))
|
||||
}
|
14
AuthentesBackend/api/routes.go
Normal file
14
AuthentesBackend/api/routes.go
Normal 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")
|
||||
}
|
Reference in New Issue
Block a user