Saturday, 13 June 2020

[Express] Redirect from a POST to a GET doesn't render html content.

I'm using ExpressJS for a web application I'm building, and I'm trying to make a simple signup and then redirect function. I have a POST route for form submission and then that redirects to a GET route:app.get('/dash', (req, res) => { console.log('dash') res.set('content-type', 'text/html'); res.sendFile(__dirname+'/pages/dash.html'); }) I know that the /dash route gets called because the chrome devtools show that the HTML was received by the GET request, but the page doesn't render the html. Any suggestions?​Edit: All code can be found at https://github.com/EvilTeliportist/Node

Submitted June 14, 2020 at 06:47AM by EvilTeliportist

No comments:

Post a Comment