Estoy creando una aplicación de microservicio NestJS en monorepo con fin como microservicio predeterminado.
Estoy usando plantillas EJS.
Pero una vez que ejecuto el proyecto, aparece el error "ERROR [ExceptionsHandler] Error al buscar la vista "índice" en el directorio de vistas "D:\Studio\Work...\fin\dist\apps\views"".
Probé diferentes configuraciones para la ruta del directorio en app.setBaseViewsDir() pero no todas funcionaron;
¿Podría ayudarme a detectar el problema?
¡Gracias por adelantado!
La carpeta del directorio del proyecto se parece a la siguiente;
+ fin + apps + fin + src + views -index.ejs -app.controller.ts -main.ts + image -package.json -tsconfig.json El archivo fin main.ts se parece a algo así;
principales.ts:
import { NestFactory } from '@nestjs/core'; import { NestExpressApplication } from '@nestjs/platform-express'; import { resolve } from 'path'; import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create<NestExpressApplication>(AppModule); app.useStaticAssets(resolve('../src/assets')); app.setBaseViewsDir(resolve('../src/views')); app.setViewEngine('ejs'); await app.listen(6006); console.log(`Fin PEN started successfully on Port 6006`); } bootstrap();El tsconfig.json se ve a continuación.
tsconfig.json:
{ "compilerOptions": { ... "sourceMap": true, "outDir": "./dist", "baseUrl": "./" ... } }