implement basic configuration
This commit is contained in:
13
main.go
13
main.go
@@ -1,9 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"git.dubyatp.xyz/chat-api-server/api"
|
||||
"github.com/joho/godotenv"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Initialize dotenv file
|
||||
err := godotenv.Load()
|
||||
if err != nil {
|
||||
// Check if environment variables are defined by OS before erroring out
|
||||
_, exists := os.LookupEnv("SCYLLA_CLUSTER")
|
||||
if !exists {
|
||||
log.Fatal("Required environment variables are not added, and no .env file was found")
|
||||
}
|
||||
}
|
||||
api.Start()
|
||||
}
|
||||
|
Reference in New Issue
Block a user