Problem with taking Glitch url and using it as a solution for question

Hi girls/guys

I’d like to share with you my 2cents after struggling with this issue and passed it successfully.

You can pass this test without using Glitch services at all. You only need to be sure that you are using res.json() properly and you are not rendering HTML or invalid JSON characters.

Here’s my solution:

let jsonTpl= `{
        "author": "John Doe",
        "description": "freeCodeCamp - Apis And Microservices Certification (300 hours)"
}`;
app.get('/_api/package.json',function(req,res){
        res.json(jsonTpl);
        res.end();
});

Hope it helps you!
PS: Why should we use Glitch? it’s an unnecessary pain.

Regards

1 Like