bradtraversy / nodecontactform

Node.js app that uses nodemailer to send emails
178 stars 173 forks source link

Error: ENOENT: no such file or directory #2

Open livetoworldlife opened 4 years ago

livetoworldlife commented 4 years ago

If you get this error below Error: ENOENT: no such file or directory

1-solution A-Create views folder look like this:

views —— layouts
—main.handlebars
—concat.handlebars

B-Then main.handlebars will be templated below

<!DOCTYPE html>
<html lang="en">
…
   <body>
     {{{body}}}
   </body>
</html>

concat.handlebars will be templated below

<div class="container">
   …..
</div>

Or

2-solution

in app.js use res.render('contact', {layout: false}); instead of res.render('contact');

sigurdurhaukur commented 4 years ago

Thanks you helped me alot!!!

DiegoHuesos commented 4 years ago

Thanks, bro!!! It was super useful!!!!