Skip to content
Advertisement

Post a form in Node Js

I am trying to post data from a form in node JS and then see the data in console. When i click the button I can see the data in console but the websites starts loading and it doesnt end. The loading circle doesnt stop moving.

JavaScript

and this is in my server.js file

JavaScript

Advertisement

Answer

Your backend has to send a response, e.g. response.sendStatus(200), otherwise the frontend will wait until it timeouts.

Example:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement