'endpoint don't work, doesn't return anything
¿can you help me to understand this?
If I have an endpoint in a specific route it will display in the browser the expected content, but with the same code just modifying the endpoint it doesn't return anything. The only change that I do is the route of the endpoint, the rest of code is the same in both cases.
¿Why this happen?
The code displays in the browser the content of a json file:
this way it doesn't work: It doesn't show an error, just don't return anything.
localhost:3000/v1/people/partner
app.get("/v1/people/partner", (req, res) => {
const peopleInVisual = PeopleController.getAllVisualPeople();
res.json({ peopleInVisual });
});
In this way it works fine: notice I just have changed the hello at the endpoint
localhost:3000/v1/hello/partner
app.get("/v1/hello/partner", (req, res) => {
const PeopleInVisual = PeopleController.getAllVisualPeople();
res.json({ PeopleInVisual });
});
Thanks!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|