Added webpack for backend
This commit is contained in:
@@ -7,6 +7,8 @@ import AuthModule from './modules/auth';
|
||||
import { ServeStaticModule } from '@nestjs/serve-static';
|
||||
import { join } from 'path';
|
||||
|
||||
declare const PROD: boolean | undefined;
|
||||
|
||||
@Controller('test')
|
||||
class TestController {
|
||||
@Role(UserRole.USER)
|
||||
@@ -31,7 +33,10 @@ class TestController {
|
||||
entities: [User, INode, JWTToken]
|
||||
}),
|
||||
ServeStaticModule.forRoot({
|
||||
rootPath: join(__dirname, '..', '..', 'frontend', 'dist'),
|
||||
rootPath:
|
||||
typeof PROD !== 'undefined' && PROD
|
||||
? join(__dirname, 'frontend')
|
||||
: join(__dirname, '..', '..', 'frontend', 'dist'),
|
||||
exclude: ['/api*']
|
||||
}),
|
||||
FileSystemModule,
|
||||
|
||||
Reference in New Issue
Block a user