Uh oh!
There was an error while loading. Please reload this page.
refactor: to biolerplate v2 (MAPCO 6292) - #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
There was a problem hiding this comment.
remove the env
you added a top-level env
| "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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| // 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. |
NivGreenstein
commented
Jul 12, 2026
Also, missing some files |
| DB_NAME: postgres | ||
| DB_USERNAME: postgres | ||
| DB_PASSWORD: postgres | ||
| # DB_SCHEMA: public |
| POSTGRES_PASSWORD: postgres | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_DB: postgres |
There was a problem hiding this comment.
remove the env
you added a top-level env
| export const SERVICE_NAME = readPackageJsonSync().name ?? 'unknown_service'; | ||
| export const DEFAULT_SERVER_PORT = 80; | ||
| export const DB_HEALTHCHECK_TIMEOUT_MS = 5000; |
There was a problem hiding this comment.
remove it if you added it to the config
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| "@map-colonies/openapi-express-viewer": "^5.0.0", | ||
| "@map-colonies/prometheus": "^1.0.0", | ||
| "@map-colonies/read-pkg": "^2.0.0", | ||
| "@map-colonies/schemas": "https://ghatmpstorage.blob.core.windows.net/npm-packages/schemas-d8f2e93dca95f6e278321177197760cf47241d5b.tgz", |
There was a problem hiding this comment.
make sure to change before you close the pr
Related issues: MAPCO-6292
Closes #XXX ...
Further information: