Tell us what’s happening:
I think the code is correct..Why arent the tests passing..pls look into it
The code :-
const express = require(‘express’);
const app = express();
const bodyParser = require(‘body-parser’)
require(‘dotenv’).config()
app.use(“/public”, express.static(__dirname + “/public”));
app.use(bodyParser.urlencoded({extended:true}))
app.post(“/name”, function(req, res) {
// Handle the data in the request
var string = req.body.first + " " + req.body.last;
res.json({ name: string });
});
###Your project link(s)
solution: https://6d3127a0-292a-4dd7-80ad-b48548e7d30d-00-3gh46a0w6ykw7.pike.replit.dev
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
Challenge Information:
Basic Node and Express - Get Data from POST Requests