const express = require("express"); const routes = require("./routes"); const app = express(); app.use("/", routes); // error handler app.use((err, req, res, next) => { res.status(err.status || 500); res.render("error"); }); module.exports = app;