POST request to express application not functional. | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

POST request to express application not functional.

I am trying to create a simple log in system using the Node.js Express Framework. The get request works fine but when I try to make a post request through the HTML form, it redirects me to a blank page which says "Your file couldn't be accessed. It may have been moved, edited or deleted." I'm sure I set the action attribute in the form to point to the post route in the express application. I really don't know what's wrong. It's driving me crazy.

28th Jan 2022, 9:41 PM
Logos
Logos - avatar
2 Réponses
0
The problem is Node JS serves you the html file, but when you submit html form, it doesn't know where to refer. By the way you use ejs for all of this?
28th Jan 2022, 10:49 PM
cadbrooke
cadbrooke - avatar
0
cadbrooke No I don't. What's that?
29th Jan 2022, 3:09 AM
Logos
Logos - avatar