From 6f245534f0c3b6ffa1ad094374bac20eaef2959d Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 23 Aug 2022 21:49:56 +0200 Subject: [PATCH] Fixed static file location for production use --- src/app.module.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app.module.ts b/src/app.module.ts index 2d23b8c..776c66e 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -6,6 +6,7 @@ import { JWTAuthGuard, Role, RoleGuard } from './authguards'; import AuthModule from './modules/auth'; import { ServeStaticModule } from '@nestjs/serve-static'; import { join } from 'path'; +import { cwd } from 'process'; declare const PROD: boolean | undefined; @@ -35,7 +36,7 @@ class TestController { ServeStaticModule.forRoot({ rootPath: typeof PROD !== 'undefined' && PROD - ? join(__dirname, 'frontend') + ? join(cwd(), 'frontend') : join(__dirname, '..', '..', 'frontend', 'dist'), exclude: ['/api*'] }),