Fixed static file location for production use
This commit is contained in:
		@@ -6,6 +6,7 @@ import { JWTAuthGuard, Role, RoleGuard } from './authguards';
 | 
				
			|||||||
import AuthModule from './modules/auth';
 | 
					import AuthModule from './modules/auth';
 | 
				
			||||||
import { ServeStaticModule } from '@nestjs/serve-static';
 | 
					import { ServeStaticModule } from '@nestjs/serve-static';
 | 
				
			||||||
import { join } from 'path';
 | 
					import { join } from 'path';
 | 
				
			||||||
 | 
					import { cwd } from 'process';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
declare const PROD: boolean | undefined;
 | 
					declare const PROD: boolean | undefined;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -35,7 +36,7 @@ class TestController {
 | 
				
			|||||||
		ServeStaticModule.forRoot({
 | 
							ServeStaticModule.forRoot({
 | 
				
			||||||
			rootPath:
 | 
								rootPath:
 | 
				
			||||||
				typeof PROD !== 'undefined' && PROD
 | 
									typeof PROD !== 'undefined' && PROD
 | 
				
			||||||
					? join(__dirname, 'frontend')
 | 
										? join(cwd(), 'frontend')
 | 
				
			||||||
					: join(__dirname, '..', '..', 'frontend', 'dist'),
 | 
										: join(__dirname, '..', '..', 'frontend', 'dist'),
 | 
				
			||||||
			exclude: ['/api*']
 | 
								exclude: ['/api*']
 | 
				
			||||||
		}),
 | 
							}),
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user