From 37e0d2c53779c228db837d5dfde84715b25351f4 Mon Sep 17 00:00:00 2001 From: jramsgz <47223013+jramsgz@users.noreply.github.com> Date: Mon, 27 Feb 2023 12:33:02 +0100 Subject: [PATCH] fea: update .env.sample file with updated values --- config/.env.sample | 15 ++++++++++++++- router/web.go | 4 ++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/config/.env.sample b/config/.env.sample index e30d19b..4129316 100644 --- a/config/.env.sample +++ b/config/.env.sample @@ -1,6 +1,19 @@ +# Here are the environment variables that are used by the application +# Default values are the ones specified in this file + DB_HOST=localhost DB_PORT=5432 DB_USER=postgres DB_PASSWORD= DB_NAME= -SECRET= \ No newline at end of file +SECRET= +# DEBUG sets isProduction to false, it enables error messages for +# HTTP requests and disables preforking and startup message +DEBUG=false +# LOG_LEVEL sets the log level for the application +# Possible values are: trace, debug, info, warn, error, fatal, panic +LOG_LEVEL=debug +# APP_ADDR sets the address and port the application will listen on +APP_ADDR=:3000 +# STATIC_DIR sets the directory where the static files are located +STATIC_DIR=static diff --git a/router/web.go b/router/web.go index 44d59ef..b271728 100644 --- a/router/web.go +++ b/router/web.go @@ -9,7 +9,7 @@ import ( func SetupWebRoutes(app *fiber.App) { // Serve Single Page application on "/" // assume static file at static folder - app.Static("/", config.Config("static_dir", "static"), fiber.Static{ + app.Static("/", config.Config("STATIC_DIR", "static"), fiber.Static{ Compress: true, MaxAge: 3600, }) @@ -28,6 +28,6 @@ func SetupWebRoutes(app *fiber.App) { }) app.Get("/*", func(ctx *fiber.Ctx) error { - return ctx.SendFile("./" + config.Config("static_dir", "static") + "/index.html") + return ctx.SendFile("./" + config.Config("STATIC_DIR", "static") + "/index.html") }) }