Unable to submit my solution on https://repl.it/

Tell us what’s happening:
It looks like repl.it changed some of their APIs and Freecodecamp is unable to check package.json file.

Your code so far
https://repl.it/@aleksspeaker/boilerplate-npm#package.json

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36.

Challenge: How to Use package.json, the Core of Any Node.js Project or npm Package

Link to the challenge:

Hello there,

It appears your app is down. Can you see any errors in the console, when you click RUN?

I checked in both states: up and down.
The point of the assignment is to add the “author” field to the package.json.
So I think it shouldn’t matter if the app is UP or DOWN since package.json never gets served by the app.

The tests access the package.json by making a request to the app…if the app is not running, then the app cannot respond with the appropriate information.

Here are the tests: freeCodeCamp/how-to-use-package.json-the-core-of-any-node.js-project-or-npm-package.md at master · freeCodeCamp/freeCodeCamp (github.com)

Here is the route the tests are checking in the app:

app.route('/_api/package.json')
  .get(function(req, res, next) {
    console.log('requested');
    fs.readFile(__dirname + '/package.json', function(err, data) {
      if(err) return next(err);
      res.type('txt').send(data.toString());
    });
  });

Hope that clarifies.

Yea, it clarifies the mechanism of fetching the package.json.
But I still don’t understand how Repl suppose to respond to that request.
If you hit this route with GET you get 404:
https://repl.it/join/niwlwfug-aleksspeaker/_api/package.json

I think you are using the incorrect link. The link to submit is the Live App link.

EDIT: In your case: https://boilerplate-npm.aleksspeaker.repl.co

I see. Thanks @Sky020.

https://boilerplate-npm.aleksspeaker.repl.co/_api/package.json

Returns the JSON file.

Thanks!

1 Like