My Project works fine and true but FCC doesn’t accept my code and I can’t pass the test. I don’t understand why?
My code so far
https://repl.it/@mihalidis/URL-Shortener#server.js
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36
.
Challenge: URL Shortener Microservice
Link to the challenge:
5mo
February 14, 2021, 8:05am
2
Hey, I just finished this challenge today. I had a go with yours and I get an error when I enter an invalid URL instead of the expected json response.
Thank you for review <3
Can you suggest a solution for my problem. Cause I really stuck here. I still working on it.
What could I be doing wrong ?
Sky020
February 14, 2021, 9:54pm
4
Hello there,
This is the user story:
You can POST a URL to /api/shorturl/new
and get a JSON response with original_url
and short_url
properties. Here’s an example: { original_url : 'https://freeCodeCamp.org', short_url : 1}
This is what happens when I do that on your app:
{"url":"https://shaunshamilton.github.io/portfolio/","hash":-1581994992}
Do you see the problem?
Hope this helps
Hey, I finally solved my problem, because you pointed me in right direction All this time I was looking the wrong way
I changed my shorturl function and I use the sha1 package in npm. Thank you <3