I recently completed a tutorial challenge where I set up a 'failure' page that included a 'Try again' button. This button redirects the user back to '/signup/html'. In my code, I utilized
app.post("/failure", (req, res) => {
res.sendFile(__dirname + "/signup.html");
});
However, in the tutorial, they used the res.redirect
method instead.
While the end result may be the same, I'm curious if there are any differences or implications between using
res.redirect
and res.sendFile
behind the scenes?
Thanks for your help!