Commit 9a552e96 authored by Fabien Forestier's avatar Fabien Forestier
Browse files

Merge branch 'development' into 'master'

Version 1.2.4

See merge request refonte-data/service-email!6
parents 17e1eb2e c4fbcdbc
Pipeline #2435 passed with stage
in 15 seconds
......@@ -24,3 +24,5 @@ npm-debug.log
swagger-spec.json
dist/
.vscode
This diff is collapsed.
{
"name": "service-email",
"version": "1.2.3",
"version": "1.2.4",
"description": "description",
"author": "",
"license": "MIT",
......@@ -33,7 +33,6 @@
"reflect-metadata": "^0.1.12",
"rxjs": "^6.2.2",
"serve-favicon": "^2.5.0",
"swagger-stats": "^0.95.7",
"typescript": "^3.0.1",
"useragent": "^2.3.0"
},
......@@ -72,4 +71,4 @@
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
\ No newline at end of file
}
import * as dotenv from 'dotenv';
import { config } from './config';
export class ConfigService {
private _config = config;
constructor() {
dotenv.config();
// Initializing conf with values from var env
this._config.smtpConfig.host = process.env.SMTP_HOST;
this._config.smtpConfig.port = process.env.SMTP_PORT;
......
......@@ -2,15 +2,13 @@ import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { ValidationPipe } from '@nestjs/common';
import * as swStats from 'swagger-stats';
import * as favicon from 'serve-favicon';
import * as path from 'path';
import { AppLogger } from './app-logger';
async function bootstrap() {
const app = await NestFactory.create(AppModule, {
logger: false,
logger: new AppLogger(),
});
app.enableCors({ credentials: true, origin: true });
......@@ -21,20 +19,15 @@ async function bootstrap() {
.setBasePath('')
.setTitle('Email service API')
.setDescription('Service providing the method to send emails.')
.setVersion('0.1')
.setVersion(process.env.npm_package_version)
.addTag('email')
.build();
const document = SwaggerModule.createDocument(app, options);
// Enable stats middleware based on the generated swagger document
app.use(swStats.getMiddleware(document));
SwaggerModule.setup('api-doc', app, document);
app.useGlobalPipes(new ValidationPipe());
app.useLogger(app.get(AppLogger));
await app.listen(3000);
}
bootstrap();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment