With reference to the user stories for the URL Shortener Microservice challenge: https://url-shortener.freecodecamp.repl.co/
- I can POST a URL to
[project_url]/api/shorturl/newand I will receive a shortened URL in the JSON response.
The example of www.google.com given in the code snippet for user story 1, would fail the second user story of:
- If I pass an invalid URL that doesn’t follow the
http(s)://www.example.com(/more/routes)format, the JSON response will contain an error like
HINT: to be sure that the submitted url points to a valid site you can use the function
dns.lookup(host, cb)from the
So I believe the example in user story 1 should be updated to: https://www.google.com.
If however, the protocol is meant to be truncated from the user’s input, then I don’t think ‘original_url’ is a good name for this key.