मैं लॉगिन प्रक्रिया सफल होने पर क्लाइंट को अगले पृष्ठ पर भेजने की कोशिश कर रहा हूं, पृष्ठ पृष्ठ की पुष्टि करता है। लेकिन मुझे कुछ त्रुटि मिल रही है। image screenshotसफल रूप से लॉगिन करने के बाद किसी अन्य पृष्ठ को रीडायरेक्ट करने के लिए कैसे करें
router.post('/sign_in', urlend, function(req, res) {
var email = req.body.user_id;
var password = req.body.password;
if (email != '' && password != '') {
user_modell.findOne({
email: email,
password: password
}, function(err, data) {
if (err) {
//res.status(500).send();
console.log('error');
} else if (!data) {
console.log('Incorrect User ID or Password');
return res.end();
} else {
res.render("confirm");
}
});
}
res.end();
});
वापसी res.redirect ('/ होमपेज'); – Lalit
पहले से ही यहां जवाब दिया गया है https://stackoverflow.com/questions/36434978/how-to-redirect-to-another-page-in-node-js – Lalit
महोदय, मैंने पहले ही यह किया है, कृपया प्रश्न में संलग्न स्क्रीनशॉट देखें। मुझे अनचाहे त्रुटि घटनाओं का सामना करना पड़ रहा है, जबकि मैं res parameeter का उपयोग कर रहा हूं। –