Answer the question
In order to leave comments, you need to log in
Why doesn't redirect work after POST request in Node.js?
I honestly searched, I didn’t find anything, I’m racking my brain, I can’t understand what’s the matter, the
form in the html file refers to the handler
app.post('/complete', function(req, res) {
completeFile = "]}";
fs.appendFile(projectName + '.json', completeFile, function(err) {
if (err) console.error(err);
console.log('file completed');
res.writeHead(301, {
Location: "result.html"
});
res.end()
});
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question