URL Shortner non-acceptance

Even though my solution gives the exact response, same as their own.
It is not being accepted. I have no idea why. There is no error, it works as intended, but it’s just refusing to check these 2 points: -

"You can POST a URL to /api/shorturl and get a JSON response with original_url and short_url properties. Here’s an example: { original_url : 'https://freeCodeCamp.org', short_url : 1}"

“When you visit /api/shorturl/<short_url> , you will be redirected to the original URL.”

I would be very grateful if anyone can figure out the issue.

Your project link(s)

solution: https://replit.com/@jenilsoni1/boilerplate-project-urlshortener

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0

Challenge: URL Shortener Microservice

Link to the challenge:

Right here:

  let regex = /^http:\/\/www|^https:\/\/www/g;

The fCC tests use your project URL (https://boilerplate-project-urlshortener.jenilsoni1.repl.co/) with some parameters to test. Your project URL will not match this regular expression and will be flagged as invalid.

1 Like

Thank you so much, that worked!!! Would have never figured that out myself :slight_smile:

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