From 5ed4787e33e258cc9afa7e9d2886a0b590d69715 Mon Sep 17 00:00:00 2001 From: Mateja Date: Sun, 9 May 2021 14:41:41 +0200 Subject: Returning validation errors and old values to `post` form. Made custom middleware for that purpose. --- index.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'index.js') diff --git a/index.js b/index.js index 743a85e..d2e486e 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,8 @@ const flash = require('connect-flash'); const passport = require('passport'); require('dotenv').config(); +const oldForm = require('./utils/middleware/oldForm'); + const webRoutes = require('./routes/web'); const app = express(); @@ -42,6 +44,8 @@ require('./config/passport'); app.use(passport.initialize()); app.use(passport.session()); +app.use(oldForm); + app.use('/', webRoutes); app.listen(process.env.PORT, () => console.log(`Server started on port ${process.env.PORT}.`)); -- cgit v1.2.3