Back End Development and APIs Projects - URL Shortener Microservice

Tell us what’s happening:

Describe your issue in detail here.

###Your project link(s)

githubLink: GitHub - alexladeira/boilerplate-project-urlshortener: freecodecamp url shortener

solution: https://3000-alexladeira-boilerplate-dkd5in99fcc.ws-eu108.gitpod.io

Your browser information:

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

Challenge Information:

Back End Development and APIs Projects - URL Shortener Microservice

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

dnsPromises.lookup takes a hostname. Your use of replace won’t do that.

You can use the URL constructor with the hostname property.

new URL('https://forum.freecodecamp.org/t/back-end-development-and-apis-projects-url-shortener-microservice/673505').hostname
'forum.freecodecamp.org'

I can’t find a way to edit the openning post, maybe because I’m a new user. But the problem that is happening is this: some tests are failing and the reason that appears on the browser console is a complaining about CORS, but this error is not happening when I run the code locally or when I run on the gitpod url. Can someone give me a hint? Thanks in advance.

Ok, thank you for the tip, I will modify the code as you suggested. The original problem that I’m having is not this, put I can’t update the content of the original post.

When I fix what I said your code passes for me (using Gitpod).

It works locally and on Gitpod but not where? I don’t understand this.

Anyway, as far as I know, you can now complete certificate projects locally as long as you also have a GitHub source link. Or if Gitpod is working use that.

It works locally and on Gitpod, but when I tried to run clicking on the button “I’ve completed this challenge” it fails with CORS errors on the console.

Please push the updated code to your repo, it still has the old code.

As I said, your code passes for me when I fix the issue I mentioned.

It is working now. Thanks!

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