Hi,
The last condition is not fulfilled but when I click on the link, it works. Can you please tell me what I have done wrong here.
Implement this route and make sure it works by going to http://localhost:8080/config in the browser
Run your code
Submit task
Help
Status
FAILED
Details
You should create the GET /config route
GET /config route should return valid JSON and status 200
GET /config route should return the CONFIG object in JSON format
import express from 'express';
import { CONFIG } from './constants.js';
const server = express();
//Here, we'll implement our routes and middleware
const version = (req, res, next) => {
if (!req.query.version || req.query.version !== '0.0.1') {
return res.status(200).json({version: '0.0.1'});
}
next();
}
server.get('/', (req, res) => {
return res.json(CONFIG)
})
server.use(version)
export { server };