feat: environment specific database handling

Changes have been made to support environment specific database file handling. By introducing a new environment variable "DB_FILE", the application's runtime now reads the database file path from the environment. In addition, subdirectories will now be automatically created if they don't exist and more detailed error messages will be printed in case of a failure. Environment variable setup and project building instructions were also updated in the README file.
This commit is contained in:
Florian Sylvain committed 2023-08-13 04:34:30 +02:00
1 parent 64ecbc6995
commit 245bf2fbf4
3 files changed
+35 -10

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@ import (
)
var possibleEnvFileLocations = []string{".env", "../.env"}
var envVarsToLoad = []string{"PORT", "ENVIRONMENT", "CORS_ALLOWED_ORIGINS"}
var envVarsToLoad = []string{"PORT", "ENVIRONMENT", "CORS_ALLOWED_ORIGINS", "DB_FILE"}
func initEnvVariables() {
var err error