Update to biolerplate v2#53
Conversation
| POSTGRES_PASSWORD: postgres | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_DB: postgres |
There was a problem hiding this comment.
Note:
You can add top-level ENVs and reference them.
See example here
| "database": "host", | ||
| "schema": "postgres" |
There was a problem hiding this comment.
revert please
| "database": "host", | |
| "schema": "postgres" | |
| "database": "dump-server", | |
| "schema": "dump_server" |
There was a problem hiding this comment.
this is already reverted dunno why its still here
| ...connectionOptions, | ||
| password: undefined, | ||
| ssl: { | ||
| key: readFileSync(ssl.key), |
There was a problem hiding this comment.
If readFilesSync fails, it throws an error. make sure it throws an indicative one
| const dbConfig = config.get<DbConfig>('db'); | ||
| const connectionOptions = createConnectionOptions({ entities: ENTITIES_DIRS, ...dbConfig }); | ||
| const config = container.resolve<ConfigType>(SERVICES.CONFIG); | ||
| const dbConfig: DbConfig = config.get('db'); |
There was a problem hiding this comment.
No need to assign DbConfig type. The type will auto resolve
| import { readPackageJsonSync } from '@map-colonies/read-pkg'; | ||
|
|
||
| export const SERVICE_NAME = readPackageJsonSync().name ?? 'unknown_service'; | ||
| export const DEFAULT_SERVER_PORT = 80; |
There was a problem hiding this comment.
please default to port 8080
| useFactory: (container): HealthCheck => { | ||
| const connection = container.resolve<Connection>(Connection); | ||
| return getDbHealthCheckFunction(connection); |
There was a problem hiding this comment.
create a function somewhere else. Don't create logic at containerConfig
| console.error('😢 - failed initializing the server'); | ||
| console.error(error); |
There was a problem hiding this comment.
why not using logger if its available? revert relevant changes
| import { getConfig, initConfig } from './common/config.js'; | ||
|
|
||
| if (isMainThread) { | ||
| await initConfig(); |
There was a problem hiding this comment.
make sure to disable it in the helm chart/ envs
|
|
||
| export const getMockObjectStorageConfig = (includeProjectId: boolean): IObjectStorageConfig => { | ||
| const objectStorageConfig: IObjectStorageConfig = { protocol: 'http', host: 'some_storage_host', port: '9000' }; | ||
| const objectStorageConfig: IObjectStorageConfig = { protocol: 'http', host: 'some_storage_host', port: 9000 }; |
There was a problem hiding this comment.
You can use nock to catch and resolve http requests.
Also, override the test config instead of this.
| // The typeorm CLI cannot await the async application config, so the db section is read directly | ||
| // from the local config file, honoring the same DB_* env overrides the schema defines for the application. |
|
Also, missing some files |
Related issues: MAPCO-6292
Closes #XXX ...
Further information: