Tell us what’s happening:
I couldn’t pass this exercise. The error says test time out. Can anyone help me out? Thanks
MyApp.js
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.post("/name", function(req, res) {
// Handle the data in the request
var string = req.body.first + " " + req.body.last;
res.json({ name: string });
});
/** 12) Get data form POST */
// This would be part of the basic setup of an Express app
// but to allow FCC to run tests, the server is already active
/** app.listen(process.env.PORT || 3000 ); */
//---------- DO NOT EDIT BELOW THIS LINE --------------------
module.exports = app;
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0
.
Challenge: undefined
Link to the challenge:
https://www.freecodecamp.org/learn/apis-and-microservices/basic-node-and-express/get-data-from-post-requests