diff options
author | lowercasename <raphaelkabo@gmail.com> | 2019-07-25 16:16:04 +0100 |
---|---|---|
committer | lowercasename <raphaelkabo@gmail.com> | 2019-07-25 16:16:04 +0100 |
commit | 930542049e40a1a99c9a0c2c349519ccddf52140 (patch) | |
tree | ace22d1e09c409bc47743a44b8f8ca41bb8b2dd6 /app.js |
First commit
Diffstat (limited to 'app.js')
-rwxr-xr-x | app.js | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -0,0 +1,32 @@ +const express = require('express'); +const path = require('path'); +const session = require('express-session'); +const cors = require('cors'); +const routes = require('./routes'); +const hbs = require('express-handlebars'); +const bodyParser = require('body-parser'); + +const app = express(); + +// Configuration // + +//app.use(cors()); +//app.use(bodyParser.json()); +//app.use(session({ secret: 'slartibartfast', cookie: { maxAge: 60000 }, resave: false, saveUninitialized: false })); + + +// View engine // + +app.engine('handlebars', hbs({defaultLayout: 'main'})); +app.set('view engine', 'handlebars'); + +// Static files // + +app.use(express.static('public')); + +// Router // + +app.use(bodyParser.urlencoded({ extended: true })); +app.use('/', routes); + +module.exports = app; |