I created a freecodecamp repo in github and am putting the different fcc projects in subdirectories so I don’t have dozens of top level fcc repos cluttering up my github account - especially the smaller things that wouldn’t be things worth deploying at the end. From what I can tell, freecodecamp seems to have out-clevered itself in trying to work around the URL that I’m submitting. I’m not allowed to use links yet, so here are the pieces that you need to find my github repo:
username = mich-cook
repo = freecodecamp
directory = boilerplate-npm
I’ve tried submitting URLs for the subdirectory, the file, and the raw version of the file that has absolutely nothing to fetch except for the text of the file.
I’ve used online JSON and package.json validators that say the JSON is valid, but the package.json file is bad because it doesn’t have a version. If I remove my author field, then it warns that that should exist as well.
The tests run, but the result is incorrect. I get this:
// running tests
package.json should have a valid “author” key
// tests completed
Your code so far
is in the github repo. not allowed to post a link to it yet.
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/80.0.3987.149 Chrome/80.0.3987.149 Safari/537.36.
@ilenia that was indeed the issue with using glitch. it’s confusing how this is working since the package.json file isn’t part of what’s being served. when the task is to validate a package.json file, it seems much more reasonable to link to that file.
@ilenia this unit appears to focus completely on the package.json file. This file is not exposed in the output of the product and it would be a huge security risk if it was.
A live app does not (and should not) have a direct way to test what’s in a package.json file. The live glitch app displays some markup that’s not related to the current challenge, does not include any text of the package.json file, and has no link to the package.json file.
It would seem that the only way that FCC currently can verify that an author field has been added (challenge #1) is to take the URL of the glitch page, disassemble it, reassemble a glitch project URL that includes the filename, grab the file from there, then validate it.
If a direct link to the package.json file is allowed, almost all of this extra work is trimmed and FCC can test the JSON file the same way just as easily. The challenge asks for a link to the solution then literally rejects almost any link that goes directly to the actual solution.
So it basically servers your package.json file in url _api/package.json. If you navigate to this path in your live app, you can see your package.json file. FCC validator is using this path to test the content of package.json file.
What you say is true but they have intentionally exposed it since this is a learning example app
@acskck thanks for pointing out how this happens. slightly different than what I guessed, but ironically the URL that you dug out ( /_api/package.json ) is also rejected as a bad solution.
It’s still odd that boilerplate-npm appears to be a repo that does nothing but create a server whose only purpose is to create an intentional security violation to serve the only file that’s used in the whole “Managing Packages” chapter that could be validated any number of other ways.
So this side path is “resolved”, I suppose, but it sounds like my original question - how to validate answers from a github repo - has no answer since there is no way to do it.