Skip to content

Instantly share code, notes, and snippets.

@paulobunga
Last active January 19, 2019 12:02
Show Gist options
  • Save paulobunga/c79ac827d9f7e3ab04305471039b178c to your computer and use it in GitHub Desktop.
Save paulobunga/c79ac827d9f7e3ab04305471039b178c to your computer and use it in GitHub Desktop.
Create the Express App
const express = require('express');
const handlebars = require('express-handlebars');
const port = PROCESS.ENV.PORT || 8080;
const app = express();
app.engine('handlebars', exphbs({defaultLayout: 'main'}));
app.set('view engine', 'handlebars');
app.get('/', (req, res) => {
res.render('index', {
title: 'Our First App'
});
);
app.listen(port, () => { console.log(`App is running on port ${port}`) });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment