-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: read environment variables with an 'env(key, defaultValue)'…
… function Replace reading environment variables using dot notation with an 'env' function call. Refactor the database factory code and fix some failing tests
- Loading branch information
1 parent
6fd0a1b
commit c2253e9
Showing
20 changed files
with
300 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
const env = require("../dotenv"); | ||
const env = require("../framework/env"); | ||
|
||
module.exports = { | ||
sourceToken: env.LOGTAIL_SOURCE_TOKEN, | ||
sourceToken: env("LOGTAIL_SOURCE_TOKEN"), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
const env = require("../dotenv"); | ||
const env = require("../framework/env"); | ||
|
||
module.exports = { | ||
url : env.REDIS_URL, | ||
host : env.REDIS_HOST, | ||
port : env.REDIS_PORT, | ||
username : env.REDIS_USERNAME, | ||
password : env.REDIS_PASSWORD, | ||
db : env.REDIS_DATABASE || "0", | ||
url : env("REDIS_URL"), | ||
host : env("REDIS_HOST", "localhost"), | ||
port : env("REDIS_PORT", 6379), | ||
username : env("REDIS_USERNAME", "default"), | ||
password : env("REDIS_PASSWORD"), | ||
db : env("REDIS_DATABASE", "0"), | ||
autoConnect : true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
const env = require("../dotenv"); | ||
const env = require("../framework/env"); | ||
const is = require("../framework/lib/is"); | ||
|
||
module.exports = { | ||
name : env.SESSION_NAME, | ||
cookieDomain : env.SESSION_COOKIE_DOMAIN, | ||
cookiePath : env.SESSION_COOKIE_PATH, | ||
expiry : 1000 * 60 * (Number(env.SESSION_EXPIRY) || 15), | ||
secret : env.SESSION_SECRET, | ||
secure : is.falsy(env.SESSION_SECURE?.toLowerCase()) ? false : true, | ||
sameSite : env.SESSION_SAME_SITE, | ||
storageDriver : (env.SESSION_STORE_DRIVER || "memory").toLowerCase(), | ||
name : env("SESSION_NAME", "connect.sid"), | ||
cookieDomain : env("SESSION_COOKIE_DOMAIN"), | ||
cookiePath : env("SESSION_COOKIE_PATH", "/"), | ||
expiry : 1000 * 60 * Number(env("SESSION_EXPIRY", 15)), | ||
secret : env("SESSION_SECRET"), | ||
secure : is.falsy(env("SESSION_SECURE").toLowerCase()) ? false : true, | ||
sameSite : env("SESSION_SAME_SITE"), | ||
storageDriver : env("SESSION_STORE_DRIVER", "memory").toLowerCase(), | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const APP_ROOT = require("app-root-path"); | ||
|
||
module.exports = APP_ROOT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.