Skip to content

Commit

Permalink
fea: update .env.sample file with updated values
Browse files Browse the repository at this point in the history
  • Loading branch information
jramsgz committed Feb 27, 2023
1 parent c4dbe5e commit 37e0d2c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 14 additions & 1 deletion config/.env.sample
Original file line number Diff line number Diff line change
@@ -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=
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
4 changes: 2 additions & 2 deletions router/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand All @@ -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")
})
}

0 comments on commit 37e0d2c

Please sign in to comment.