fix(challenge): fix instructions in serve json challenge#13155
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@Greenheart I also see a couple other things that could use improvement and I'd like to see if you agree. I kind of did this PR in a hurry last night, so didn't have time to think too critically about this. First:
Not sure if I like the "?" here, I think it should maybe be:
Second: The reference to APIs in the first paragraph here is overall a bit confusing. We are provided with some good info on APIs, but I don't think the concept is sufficiently tied in to the challenge at hand. For instance, as a first time learner of this info (which gives me good perspective), I'm not totally clear on what part of what we're doing in this challenge actually involves an API. Ae we actually creating an API that serves JSON with this code? Or are we hitting an API that responds with JSON? Or both? I think the former, but if so, who / what is going to utilize this API down the line? I think it exemplifies the concept of serving JSON well, but could perhaps tie in to the larger scope of building a web app better. Ideally in a concise way that would only add another sentence or 2. Any thoughts? Third:
Since we tell campers in the NPM challenges that JSON keys and values must always be wrapped in double quotes, do you think we should point out here that its best practice not to wrap keys in double quotes like this when sending JSON? I noticed the example follows just regular object notation, and I think someone mentioned to me that this is best practices. |
1 -Yes!2Think of an API as a collection of functions. They have different names, might take input and might give some response back. We're creating a simple API-endpoint (a function) just for demonstration purposes in this case that only will be used by the tests. I like your idea with how APIs fit into the big picture! I currently don't see how we could improve the description, but I'm open for suggestions! 😊 3Good point! How about if we use |
|
Perfect for 1 & 3! 2I get the concepts of an API, and figured as much about only being used for the tests I guess, but to clarify to someone who has never done this before (as I think people who understand it already read it and it clicks for them, so can be a bit biased), how about we just say:
I think this would just help to tie things together a bit, and let campers know, with no room for confusion: "what you're doing is creating an API". Since it only adds a few words, I think its worth it for the extra clarity 😄 Also, what about explaining what REST means? |
63b3d9b to
4b61aa1
Compare
|
@Greenheart I added the suggestions you had the other day, and made the fixes we (sort of) talked about for the API piece of it. Take a look and let me know if you're good with this. All I really added was "Lets create a simple API by creating a route..." That way it's clear why the explanation of an API was there and ties it in to the challenge a bit more. |
Greenheart
left a comment
There was a problem hiding this comment.
@no-stack-dub-sack Sorry for not responding earlier.
This is definitely an improvement, great job! 😄
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
4b61aa1 to
d49d638
Compare
|
@Greenheart Ok, all set, see my note in the outdated about the |
@no-stack-dub-sack Good point! I'd say we could add I think that's the last change needed, but what do you say? |
|
@Greenheart yup, I anticipated that and the change was made with yesterday's commit, so if you're review is a thumbs up at this point, it should be good to merge! 😄 |
Greenheart
left a comment
There was a problem hiding this comment.
@no-stack-dub-sack Again, the delay... 😅
Actually I found something!
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
d49d638 to
c54a21a
Compare
|
@Greenheart 😱 lol, ok, NOW it's ready... good eye. Although, to be fair, when I was doing this challenge, it didn't seem to matter in what format you sent the object, it would always get converted and come out in correct JSON format, but if I recall correctly, you could send However, I agree that for consistency and so as not to confuse, this makes the most sense. |
Greenheart
left a comment
There was a problem hiding this comment.
@no-stack-dub-sack Haha yeah now it's ready!
That's because the res.json() method of Express serializes JSON based on a wide variety of input data, like JS objects that are valid even with single quotes (').
Now, finally, let's continue with other improvements! 😄
Pre-Submission Checklist
stagingbranch of freeCodeCamp.fix/,feature/, ortranslate/(e.g.fix/signin-issue)npm test. Usegit commit --amendto amend any fixes.Type of Change
Checklist:
Description
<code>tags to methods described in instructions<em>