The Notes home page

We're going to modify the starter application to support creating, editing, updating, viewing, and deleting notes. Let's start by fixing up the home page. It should show a list of notes, and the top navigation bar should link to an ADD Note page so that we can always add a new note.

While we will be modifying the generated app.js, it needs no modification to support the home page. These lines of code are related to the home page:

const index = require('./routes/index'); 
.. 
app.use('/', index); 

Additionally, to support Handlebars templates app.js requires these changes:

const hbs = require('hbs');...app.set('view engine', 'hbs');hbs.registerPartials(path.join(__dirname, 'partials'));

We'll put Handlebars partials in a ...

Get Node.js Web Development - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.