mirror of
https://github.com/amineo/t2-stat-parser.git
synced 2026-04-27 14:35:21 +00:00
Set API https
This commit is contained in:
parent
87bfab307d
commit
80056903c6
3 changed files with 14 additions and 7 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import * as fs from 'fs';
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { ValidationPipe } from '@nestjs/common';
|
||||
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
|
||||
|
|
@ -5,7 +6,13 @@ import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
|
|||
import { AppModule } from './app.module';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
// Use local gen'd cert in container
|
||||
const httpsOptions = {
|
||||
key: fs.readFileSync('/localcert/key.pem', 'utf8'),
|
||||
cert: fs.readFileSync('/localcert/cert.pem', 'utf8')
|
||||
};
|
||||
|
||||
const app = await NestFactory.create(AppModule, { httpsOptions });
|
||||
|
||||
app.enableCors({
|
||||
credentials: true
|
||||
|
|
@ -33,6 +40,6 @@ async function bootstrap() {
|
|||
const document = SwaggerModule.createDocument(app, swaggerOptions);
|
||||
SwaggerModule.setup('docs', app, document);
|
||||
|
||||
await app.listen(8080);
|
||||
await app.listen(8443);
|
||||
}
|
||||
bootstrap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue