0

In my nodejs app I need to render html files. The view engine is currently set to jade but I am not using this format.

I need it set so that i can render the relevant html page.

Cheers

tjhack
  • 1,022
  • 3
  • 20
  • 43

1 Answers1

0

You don't need a view engine to serve HTML. Instead, just use the static middleware:

app.use(express.static(__dirname + '/public'));
Dan Kohn
  • 33,811
  • 9
  • 84
  • 100
  • so if my views sit under the app/views folder would the /public needs to be changed to /app/views? – tjhack Jan 16 '14 at 15:14
  • No joy i get the following error 500 Error: Failed to lookup view "views/admin/users.html. I have tried to use consolidate.js following this example but still no joy. http://stackoverflow.com/questions/18210532/trying-to-render-html-files-using-jade-but-it-still-adresses-it-as-a-jade. My engine is app.use(express.static(path.join(__dirname, '/app'))); Within app there is a view folder – tjhack Jan 17 '14 at 11:56