January 2018
Beginner
658 pages
13h 10m
English
Inside Atom, let's get started by loading in handlebars const hbs = require hbs, as shown and from here we can add that one line:
const express = require('express');const hbs = require('hbs');
Next, let's call app.set where we call app.use for Express static:
app.setapp.use(express.static(__dirname + '/public'));
This lets us set some various Express-related configurations. There's a lot of built-in ones. We'll be talking about more of them later. For now, about what we'll do is pass in a key-value pair, where the key is the thing you want to set and the value is the value you want to use. In this case, the key we're setting is view engine. This will tell Express what view engine we'd like to use and we'll pass in inside ...
Read now
Unlock full access