Tell us what’s happening:
Hey, I’m totally stuck. Both locally and with replit I receive the correct results but tests are not passing at all :((
Task:
Code:
require('dotenv').config()
let express = require('express');
let app = express();
let bodyParser = require('body-parser');
app.listen(3001)
const absolutePath = __dirname + "/views/index.html"
app.get("/", function (req, res) {
res.sendFile(absolutePath);
});
app.get("/name", function (req, res) {
console.log(`${req.query.first} ${req.query.last}`)
res.json({
name: `${req.query.first} ${req.query.last}`
});
});
app.use("/public", express.static(__dirname + "/public"));
module.exports = app;
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Challenge: Basic Node and Express - Get Query Parameter Input from the Client
Link to the challenge: