const express = require('express'); const path = require('path'); const bodyParser = require('body-parser'); const cookieParser = require('cookie-parser'); const logger = require('morgan'); const router = require('./routes'); const app = express(); app.use(logger('dev')); app.use(express.json()); app.use(express.urlencoded({ extended: false })); app.use(bodyParser.json()); app.use(cookieParser()); app.use(express.static(path.join(__dirname, 'public'))); app.use('/', router); module.exports = app;