I am building a node.js app. I would like that after the admin has successfully uploaded data the homepage is rendered, that is, from localhost:3000/admin to localhost:3000 . I've tried with the code below: router.post('/', (req, res)=>{upload(req, res, function(err) { if (err) { console.log(err); res.render('admin', {msg: err}); }else{ return res.redirect('index'); } } and this is the index.js code: var express = require('express'); var router...
Originally asked by Eric O. on Stack Exchange (stackoverflow) (CC BY-SA 4.0).