I am following the tutorials in O'Reilly's "Web Development with Node & Express" by Ethan Brown.
They use handlebars as the view engine.
Here is my code:
var express = require ('express'),
handlebars = require('express3-handlebars'),
app = express();
handlebars.create({ defaultLayout: 'main' });
app.engine('handlebars', handlebars.engine);
The problem I am having is that handlebars.engine is undefined, resulting in a "Callback function expected" error when running the application.
I have tried searching online without any luck.
Is this some legacy syntax with handlebars? My packages have installed fine and I have tried reinstalling them.
Is there a fix/updated code for this?