learnyounode
learnyounode copied to clipboard
HTTP JSON API SERVER does not check 200, 404
Although it is just a hint to return 200 with appropriate header:
You should also be a good web citizen and set the Content-Type properly:
res.writeHead(200, { 'Content-Type': 'application/json' })
the official solution has this as well as 404 if a URL other than "/api/parsetime" or "/api/unixtime" is requested.
My opinion is if the official solution has it, it should be verified for the submitted solution.
I like the idea that the workshopper enforces being a "good web citizen" in the few last exercises, but I'm not married to it. Let's discuss here if the 200 and 404 should be checked.
It seems like a reasonable request.