janl / mustache.js

Minimal templating with {{mustaches}} in JavaScript
https://mustache.github.io
MIT License
16.37k stars 2.4k forks source link

Is it possible to set mustache as view engine? #791

Closed ramseth001 closed 3 years ago

ramseth001 commented 3 years ago

When I did this

app.set("view engine", "mustache");

I got this error

Error: Module "mustache" does not provide a view engine.

Also, I could not find "mustache" in this list from Express website.

phillipj commented 3 years ago

mustache.js is not directly compatible with express.js, no.

There has to be something in between, that knows how to work as a view engine for express.js and at the same time knows how to use mustache.js.

I've used something like consolidate.js in the past for this. Whether or not it still does the trick, or if better alternatives has been created, I honestly don't know.

Closing this issue since it's not an issue with mustache.js itself.