From 3d8639027c5cf56dbfc09f3aa888ecf3f6e65769 Mon Sep 17 00:00:00 2001 From: Alice GG Date: Sat, 3 Jun 2023 22:06:54 +0200 Subject: [PATCH] log.Panic in case of failed Run --- README.md | 6 +++--- backend/main.go | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a969097..d589e45 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,9 @@ Launch the app using docker: ```sh docker run -v ~/Code/Mikochi/data:/data \ --p 8080:8080 -e host="0.0.0.0:8080" \ --e data_dir="/data" -e jwt_secret=my_secret \ --e username=root -e password=pass \ +-p 8080:8080 -e HOST="0.0.0.0:8080" \ +-e DATA_DIR="/data" -e JWT_SECRET=my_super_secret \ +-e USERNAME=my_username -e PASSWORD=my_secure_password \ zer0tonin/mikochi:latest ``` diff --git a/backend/main.go b/backend/main.go index a8bddc5..95c9397 100644 --- a/backend/main.go +++ b/backend/main.go @@ -59,5 +59,8 @@ func main() { host := viper.GetString("HOST") log.Print("Listening on " + host) - r.Run(host) + err := r.Run(host) + if err != nil { + log.Panicf("Failed to launch web server: %s", err.Error()) + } }