Skip to content

Commit 6e73a92

Browse files
committed
fix:webpack
1 parent 97ee328 commit 6e73a92

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/main.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,28 @@ import { NestFactory } from '@nestjs/core';
33
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
44
import { RedocModule, RedocOptions } from 'nestjs-redoc';
55
import { AppModule } from './app.module';
6+
import { join } from 'path';
7+
import { NestExpressApplication } from '@nestjs/platform-express';
8+
9+
import * as express from 'express';
610

711
class ServerController {
8-
private app!: INestApplication;
12+
private app!: NestExpressApplication;
13+
914
private readonly globalPrefix = 'api';
1015
private readonly port = process.env.PORT || 3000;
1116

1217
async createServer(): Promise<void> {
18+
19+
this.app = (await NestFactory.create<NestExpressApplication>(AppModule));
1320
// this.app = await NestFactory.create(AppModule);
14-
// this.app = await NestFactory.create(AppModule) as INestApplication;
21+
22+
23+
// this.app = (await NestFactory.create(AppModule)) as INestApplication;
24+
25+
26+
this.app.use('/docs', express.static(join(__dirname, 'docs')));
1527

16-
this.app = (await NestFactory.create(AppModule)) as INestApplication;
1728
this.app.enableCors({
1829
origin: '*', // Allow all origins
1930
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE', // Allowed HTTP methods

0 commit comments

Comments
 (0)