API Project: URL Shortener Microservice instructions

With reference to the user stories for the URL Shortener Microservice challenge: https://url-shortener.freecodecamp.repl.co/

  1. I can POST a URL to [project_url]/api/shorturl/new and I will receive a shortened URL in the JSON response.
    Example : {"original_url":"www.google.com","short_url":1}

The example of www.google.com given in the code snippet for user story 1, would fail the second user story of:

  1. 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 {"error":"invalid URL"}
    HINT: to be sure that the submitted url points to a valid site you can use the function dns.lookup(host, cb) from the dns core module.

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.

That’s a good point. We may want to update the user story to have the correct requirements

Hello there,

Those are currently being updated:

There are also other issues referencing it. But, the user stories on the example project, and webpage of all projects/boilerplate are being removed.

1 Like