Skip to content

Commit

Permalink
chore(): add sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
bgdsh committed May 8, 2019
1 parent b2ecd62 commit a079d6a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
4 changes: 4 additions & 0 deletions project-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"projectVersion": "1.6.0",
"apiVersion": "1.1.0"
}
4 changes: 4 additions & 0 deletions src/interfaces/project-config.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface ProjectConfig {
projectVersion: string;
apiVersion: string;
}
10 changes: 8 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ import {
ValidationPipe,
HttpExceptionFilter,
corsOptions,
logger,
} from '@pardjs/common';

import { AppModule } from './app.module';
import * as VERSION from '../version.js';
import { readFileSync } from 'fs';
import { join } from 'path';
import { ProjectConfig } from './interfaces/project-config.interface';

const projectConfig: ProjectConfig = JSON.parse(readFileSync(join(process.cwd(), 'project-config.json')).toString());
logger.info('project config', { projectConfig });

async function bootstrap() {
const app = await NestFactory.create(AppModule);
Expand All @@ -30,7 +36,7 @@ async function bootstrap() {
.setTitle('Pardjs Form Service')
.setDescription('The form service of Pardjs')
.setContactEmail('[email protected]')
.setVersion(VERSION.api)
.setVersion(projectConfig.apiVersion)
.setBasePath(process.env.SERVICE_BASE + '/api')
.addTag('FormService')
.setSchemes('http', 'https')
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"module": "commonjs",
"declaration": true,
"removeComments": true,
"resolveJsonModule": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
Expand All @@ -12,5 +11,7 @@
"baseUrl": "./",
"sourceRoot": "./src"
},
"exclude": ["node_modules"]
"exclude": [
"node_modules"
]
}
4 changes: 0 additions & 4 deletions version.js

This file was deleted.

0 comments on commit a079d6a

Please sign in to comment.