Https://www.freecodecamp.org/learn/back-end-development-and-apis/back-end-development-and-apis-projects/url-shortener-microservice

Tell us what’s happening:
I don’t understand why this is failing the test for valid url. Its the only test it’s failing and I cant see why. Here is a console.log of whats going on during the test. Please tell me i t doesn’t expect uppercase Invalid URL (like the example) vs lowercase (like the user story). I’m getting really frustrated refactoring this over and over.
Its doing what its supposed to. Please help me understand what’s happening

Lowercase (like user story)

node v12.16.1
{ url: 'https://fccbackend3.avatar414.repl.co/?v=1636333291233' }
hello 32
{ url: 'https://fccbackend3.avatar414.repl.co/?v=1636333291567' }
hello 33
{ url: 'ftp:/john-doe.org' }
{ error: 'invalid url' }

Uppercase (like Example program)

Listening on port 3000
{ url: 'https://fccbackend3.avatar414.repl.co/?v=1636333974082' }
hello 36
{ url: 'https://fccbackend3.avatar414.repl.co/?v=1636333974609' }
hello 37
{ url: 'ftp:/john-doe.org' }
{ error: 'Invalid URL' }

Here is the relevant code

Your project link(s)

solution: https://replit.com/@avatar414/fccbackend3

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0

Challenge: URL Shortener Microservice

Link to the challenge:

Nevermind. It didnt like the 400 series response for an error. Send it as a 200 and it passes…

C’mon now… :rofl:

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