Added webpack for backend

This commit is contained in:
2022-08-22 16:52:02 +02:00
parent 1445f7341e
commit adb21337bc
5 changed files with 873 additions and 44 deletions

View File

@@ -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,