hunk7
1
Tell us what’s happening:
Your code so far
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
.
Challenge: undefined
Link to the challenge:
hunk7
2
Solved It !!!
app.use(bodyParser.urlencoded({ extended: true }));
app.post("/name",function(req,res){
var jsonObj=req.body.first+" "+req.body.last;
res.send({name:jsonObj});
console.log(req.body.first+" "+req.body.last);
})
app.get("/", function(req, res) {
res.sendFile(path.join(__dirname + "/views/index.html"));
});