URL Shortener Microservice Challenge
If the URL is invalid, I wrote,
res.send({ error: 'invalid url' });
I do get the proper error, but it shows up as
{"error":"invalid url"}
on the page. But since the test required the error to show up like this { error: 'invalid url' }
, I suspect it is a matter of format.
How do I properly format the JSON data so it shows up the way they want it? Otherwise, I have no idea why that test failed, since they don’t provide their inputs and expected outputs.
Thank you!
My project links
githubLink: GitHub - brpasiliao/boilerplate-project-urlshortener: A boilerplate for a freeCodeCamp project.
solution: https://replit.com/@brpasiliao/boilerplate-project-urlshortener
My browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36