Tuesday, 27 February 2018

Sending form data to nodejs server

I am trying to achieve a very basic thing but couldn't find any proper documentation or example on the web somehow (probably my bad).I have a very basic HTML form. This form lies on http://localhost:3000/post
Company Name:

Job Title:
When I submit it, I want to pass this information to my nodeJS server, which is running on port 3001.I tried something as follows to at least see what's going on but no luckconst express = require('express'); const cors = require('cors'); let app = express(); app.use(cors()); app.get('/post', (req,res) => { console.log(req,res) }) app.listen(3001);

Submitted February 27, 2018 at 09:19PM by eligloys

No comments:

Post a Comment