mirror of
https://codeberg.org/SafeTwitch/safetwitch-backend.git
synced 2024-12-22 13:13:00 -05:00
Check for env vars
This commit is contained in:
parent
8baaa9a369
commit
547bbbd214
1 changed files with 8 additions and 0 deletions
8
main.go
8
main.go
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"safetwitch-backend/routes"
|
"safetwitch-backend/routes"
|
||||||
|
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -32,6 +33,13 @@ func notFoundHandler(context *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
// check for env
|
||||||
|
env := os.Getenv("URL")
|
||||||
|
if env == "" {
|
||||||
|
fmt.Println("ENV Variable 'URL' is not present")
|
||||||
|
os.Exit(10)
|
||||||
|
}
|
||||||
|
|
||||||
router := gin.Default()
|
router := gin.Default()
|
||||||
router.Use(ErrorHandler)
|
router.Use(ErrorHandler)
|
||||||
routes.SetRoutes(router)
|
routes.SetRoutes(router)
|
||||||
|
|
Loading…
Reference in a new issue