const express = require('express'); const path = require('path'); require('dotenv').config(); env = process.env; const app = express(); app.use(express.json()); app.use(express.urlencoded({ extended: false })); app.use(require('cookie-parser')()); app.use(express.static(path.join(__dirname, 'static'))); app.use('/', require('./routes/index.js')); // catch 404 and forward to error handler app.use(function(req, res, next) { res.status(404); res.end('