Response redirect in Connect
问题 In Express, Im able to redirect to other url using response.redirect(""). Similarly how can I redirect in Connect module? I've tried the below code but its not working. response.setHeader('Content-Type', 'text/plain'); response.end('<p>302. Redirecting to <a href="' + url+ '">' + url+ '</a></p>'); 回答1: You can also redirect in Connect using writeHead as follows: res.writeHead(301, {Location: url}); res.end(); The 301 http status code means "moved permanently". 回答2: res.redirect is defined in