-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(contracts): extract environment variables (#430)
* Rename file * Rename flags to EnvVariables * Fix type * Move env variables under kernel * Add DB env variables * Remove unused defaults * Api env variables * Epi development variables * Apie transaction pool environment variables
- Loading branch information
1 parent
b21b032
commit 28d3700
Showing
32 changed files
with
266 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
import { Constants } from "@mainsail/contracts"; | ||
import { Environment } from "@mainsail/kernel"; | ||
|
||
export const defaults = { | ||
database: { | ||
applicationName: "mainsail/api-http", | ||
database: | ||
Environment.get("CORE_DB_DATABASE") ?? | ||
`${Environment.get("CORE_TOKEN")}_${Environment.get("CORE_NETWORK_NAME")}`, | ||
Environment.get(Constants.EnvironmentVariables.CORE_DB_DATABASE) ?? | ||
`${Environment.get(Constants.EnvironmentVariables.CORE_TOKEN)}_${Environment.get(Constants.EnvironmentVariables.CORE_NETWORK_NAME)}`, | ||
entityPrefix: "public.", | ||
// TODO | ||
extra: { | ||
options: "-c statement_timeout=3000ms", | ||
}, | ||
|
||
host: Environment.get("CORE_DB_HOST", "localhost"), | ||
host: Environment.get(Constants.EnvironmentVariables.CORE_DB_HOST, "localhost"), | ||
|
||
logger: "simple-console", | ||
|
||
logging: Environment.isTrue("CORE_DB_LOGGING_ENABLED"), | ||
logging: Environment.isTrue(Constants.EnvironmentVariables.CORE_DB_LOGGING_ENABLED), | ||
|
||
password: Environment.get("CORE_DB_PASSWORD", "password"), | ||
password: Environment.get(Constants.EnvironmentVariables.CORE_DB_PASSWORD, "password"), | ||
|
||
port: Environment.get("CORE_DB_PORT", 5432), | ||
port: Environment.get(Constants.EnvironmentVariables.CORE_DB_PORT, 5432), | ||
|
||
type: "postgres", | ||
username: Environment.get("CORE_DB_USERNAME") ?? Environment.get("CORE_TOKEN"), | ||
username: | ||
Environment.get(Constants.EnvironmentVariables.CORE_DB_USERNAME) ?? | ||
Environment.get(Constants.EnvironmentVariables.CORE_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
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 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
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
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.