Closed ThomasPCG closed 6 years ago
There's this example on the readme using express.
Also, the express documentation has a lot more information on how to use template engines. Here's a guide specifically for that
BTW... what you're doing in the code above is calling the handlebars
engine directly, which is attempting to render something. Instead, just use this line:
app.engine('html', engines.handlebars);
Then see the express
documentation for setting the views
path and how you can pass helpers
to the engine when rendering (I think you can add them as locals... app.locals.helpers = handleBarHelpers;
but I'm not positive).
I'm doing this...
but apparently it's failing because there is a path which I need to specify?
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot set property 'filename' of undefined
I can't find any API for the constructors above in the documentation. Can anyone guide me to the right place for this?