final config changes
This commit is contained in:
parent
718ace05b0
commit
19f05a2a69
7 changed files with 311 additions and 51 deletions
|
|
@ -8,7 +8,7 @@ This guide shows how to use the envalid-based configuration system in the Stock
|
|||
import { databaseConfig, loggingConfig, riskConfig, dataProvidersConfig } from '@stock-bot/config';
|
||||
|
||||
// Access individual values
|
||||
console.log(`Database: ${databaseConfig.DB_HOST}:${databaseConfig.DB_PORT}`);
|
||||
console.log(`Database: ${databaseConfig.POSTGRES_HOST}:${databaseConfig.POSTGRES_PORT}`);
|
||||
console.log(`Log level: ${loggingConfig.LOG_LEVEL}`);
|
||||
console.log(`Max position size: ${riskConfig.RISK_MAX_POSITION_SIZE}`);
|
||||
```
|
||||
|
|
@ -68,9 +68,9 @@ import type { DatabaseConfig, LoggingConfig, RiskConfig } from '@stock-bot/confi
|
|||
function setupDatabase(config: DatabaseConfig) {
|
||||
// TypeScript knows all the available properties
|
||||
return {
|
||||
host: config.DB_HOST,
|
||||
port: config.DB_PORT, // number
|
||||
ssl: config.DB_SSL, // boolean
|
||||
host: config.POSTGRES_HOST,
|
||||
port: config.POSTGRES_PORT, // number
|
||||
ssl: config.POSTGRES_SSL, // boolean
|
||||
};
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue