jeudi 27 août 2020

How to render a page then download it in express js

I want to render a page (output.ejs) and then download that same page all with one button click. In my POST method I redirect to "/output" where the GET request renders output.ejs. However I cannot call res.download("") after that render (something to do with it being asynchronous). What's the best way at tackling this. BTW I am using wkhtmltopdf as PDF generation which needs to happen AFTER the page gets rendered since I am sending data to it.

Best




Aucun commentaire:

Enregistrer un commentaire