node.js - Using res.location with res.render -


i have user submit file using post /upload, want browser render index.mustache , tell browser location /. attempted following code (in multer's onfileuploadcomplete):

res.location('/'); res.render('index', {options: 'whatever'}); 

it renders index, browser displays location /upload, not / desire. doing wrong?

(answering own question)

i able solve situation using res.redirect('/') , placing {options: 'whatever'} logic elsewhere.


Comments