Env variables added
All checks were successful
Build Feedmee Go Backend App / build-and-push (push) Successful in 1m4s
Build Feedmee Next.js Frontend App / build-and-push (push) Successful in 13s

This commit is contained in:
2025-10-16 15:55:43 +02:00
parent 63c6031d66
commit 08bf952988
3 changed files with 18 additions and 0 deletions

View File

@@ -6,10 +6,13 @@ import (
"fmt"
"log"
"net/http"
"os"
"strconv"
"strings"
"time"
"github.com/joho/godotenv"
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
"github.com/go-chi/cors"
@@ -1017,6 +1020,18 @@ func server(app *App) *http.Server {
}
func main() {
err := godotenv.Load()
if err != nil {
log.Println("Cannot find .env file, using system env variables")
}
adminUser := os.Getenv("ADMIN_USER")
adminPass := os.Getenv("ADMIN_PASS")
if adminUser == "" || adminPass == "" {
log.Fatal("No ADMIN_USER or ADMIN_PASS env variable set")
}
db := database()
defer db.Close()