aboutsummaryrefslogblamecommitdiff
path: root/index.js
blob: b7eb95bc1b021f64e42924daf8e0536b06dcd1ca (plain) (tree)
1
2
3
4
5
6
7
8
9
                                   
                                             
 
                      
 


                                     
                            










                                    
   
 
                                                                    
const express = require('express');
const exphbs = require('express-handlebars');

const app = express();

app.engine('handlebars', exphbs());
app.set('view engine', 'handlebars');

app.get('/', (req, res) => {
  res.render('home', {
    title: 'Home Page',
    home: true
  });
});

app.get('/new-post', (req, res) => {
  res.render('new-post', {
    title: 'Make A New Post',
    newPost: true
  });
});

app.listen(8080, () => console.log('Server started on port 8080.'));