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


                                     

                                  

                                               
                        
 
                                                                    
const express = require('express');
const exphbs = require('express-handlebars');
const mongoose = require('mongoose');
const webRoutes = require('./routes/web');

const app = express();
mongoose.connect('mongodb://localhost/playground_db', {useNewUrlParser: true, useUnifiedTopology: true});

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

app.use(express.static('public'));

app.use(express.urlencoded({extended: false}));

app.use('/', webRoutes);

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