Back End Development and APIs Projects - URL Shortener Microservice

Tell us what’s happening:
The test feedback says “If you pass an invalid URL that doesn’t follow the valid http://www.example.com format, the JSON response will contain { error: ‘invalid url’ }”, but I actually have done that.

Your project link(s)

solution: boilerplate-project-urlshortener - Node.js Repl - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36

Challenge: Back End Development and APIs Projects - URL Shortener Microservice

Link to the challenge:

It’s not detecting invalid URLs. Logging the route inputs yields

req.body: {"url":"ftp:/john-doe.invalidTLD"}
req.params: {}
req.query: {}
url is valid.

That URL is not valid.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.