Created
February 3, 2018 06:21
-
-
Save vickonrails/5b3d410928c07f45cde6a78ab67ffd99 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'), | |
hbs = require('express-handlebars').create({defaultLayout:'main.hbs'}), | |
app = express(); | |
//setting our app engine to handlebars | |
app.engine('hbs', hbs.engine); | |
app.set('view engine', 'hbs'); | |
app.get('/',(request,response)=>{ | |
response.render('home',{title: 'Home'}); | |
}); | |
app.get('/about',(request,response)=>{ | |
response.render(‘about’,{title: ‘About’}); | |
}); | |
app.listen(3000,()=>console.log('Express server started at port 3000')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment