Complete the code to redirect the user to '/home'.
app.get('/start', (req, res) => { res.[1]('/home'); });
The res.redirect() method sends a redirect response to the client, telling it to go to a different URL.
Complete the code to redirect with a 301 status code to '/new-page'.
app.get('/old-page', (req, res) => { res.status(301).[1]('/new-page'); });
Use res.redirect() after setting the status code to send a permanent redirect (301).
Fix the error in the code to properly redirect to '/dashboard'.
app.get('/login', (req, res) => { res.redirect [1] '/dashboard'; });
The redirect method requires parentheses around the URL string.
Fill both blanks to redirect with a 302 status code to '/profile'.
app.get('/user', (req, res) => { res.[1]([2], '/profile'); });
Use res.redirect(statusCode, url) to redirect with a specific status code like 302.
Fill all three blanks to redirect to '/logout' only if user is logged in.
app.get('/exit', (req, res) => { if (req.user) { res.[1]([2], [3]); } else { res.send('Not logged in'); } });
Use res.redirect(302, '/logout') to redirect logged-in users to logout.
