mirror of
https://github.com/JuLi0n21/pwa-player.git
synced 2026-04-19 23:40:05 +00:00
30 lines
435 B
Go
30 lines
435 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/joho/godotenv"
|
|
)
|
|
|
|
func main() {
|
|
|
|
if value := os.Getenv("ENV"); value == "prod" {
|
|
if ok := godotenv.Load(".env"); ok != nil {
|
|
panic(".env not found")
|
|
}
|
|
} else {
|
|
fmt.Println("Not Produktion Enviorment fallback to dev.env")
|
|
if ok := godotenv.Load("dev.env"); ok != nil {
|
|
panic("dev.env not found")
|
|
}
|
|
|
|
}
|
|
InitDB()
|
|
|
|
err := run()
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
}
|