Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
build: correctly initializing default environment
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSlimvReal committed Feb 12, 2024
1 parent f56befb commit d7ca398
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ COPY package*.json ./
RUN npm ci --no-progress --only=production

COPY --from=builder /app/dist ./dist
COPY --from=builder /app/.env ./

# (optional) The sentry DSN in order to send the error messages to sentry
ENV SENTRY_DSN=""
Expand Down
2 changes: 1 addition & 1 deletion src/app.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('AppController', () => {
get: jest.fn().mockReturnValue(of({ data: undefined })),
};
const mockConfigService = {
get: (key) => {
getOrThrow: (key) => {
switch (key) {
case 'DATABASE_URL':
return dbUrl;
Expand Down
10 changes: 5 additions & 5 deletions src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import { QueryBody } from './query-body.dto';

@Controller('report')
export class AppController {
private dbUrl = this.configService.get('DATABASE_URL');
private queryUrl = this.configService.get('QUERY_URL');
private schemaDocId = this.configService.get('SCHEMA_CONFIG_ID');
private couchAdmin = this.configService.get('DATABASE_ADMIN');
private couchPassword = this.configService.get('DATABASE_PASSWORD');
private dbUrl = this.configService.getOrThrow('DATABASE_URL');
private queryUrl = this.configService.getOrThrow('QUERY_URL');
private schemaDocId = this.configService.getOrThrow('SCHEMA_CONFIG_ID');
private couchAdmin = this.configService.getOrThrow('DATABASE_ADMIN');
private couchPassword = this.configService.getOrThrow('DATABASE_PASSWORD');
constructor(
private http: HttpService,
private configService: ConfigService,
Expand Down

0 comments on commit d7ca398

Please sign in to comment.