Use Pug in Nest
See original GitHub issueI need to use pug in my projects, and i have this problem:
renderRecibo = (req, res, next) =>{
try{
var options = { format: 'A4' };
let html = pug.renderFile("../../views/recibo.pug"
If i use only Node, works, but in Nest no.
In main file of Nest, i have:
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'pug');
thanks for all help.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
Set "basedir" option for Pug in NestJS - node.js - Stack Overflow
I'm trying to use pug ...
Read more >Pug: Getting Started
The general rendering process of Pug is simple. pug.compile() will compile the Pug source code into a JavaScript function that takes a data...
Read more >NestJS Crash Course 04 | MVC and server-side rendering ...
In this video we are going to reuse our NestJS Job Controller to list the job positions using MVC and server-side rendering with...
Read more >MVC | NestJS - A progressive Node.js framework
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines ...
Read more >Pug - nestjs-i18n
To enable pug support make use of the viewEngine option inside your I18nModule . src/app.module.ts. I18nModule.forRoot({
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @franciscoffavaro, i use Pug in this example and it works perfect
Hi @cdiaz, it’s the same code of i have in my app. The problem is, i have a method called renderRecido. I get a pug file and render to make a pdf file and show. But all time, the file path send me an error:
Not found the file, but the path is right. I really don’t know whats happening.