Project feedback URL Shortener Microservice

<%= @topic_view.topic.title %>
<%= @topic_view.topic.average_rating %> <%= @topic_view.topic.posts.count { |p| !!p.custom_fields['rating'] } %>

Hey guys, I’ve just finished URL Shortener Microservice. Please take a look and tell me what do you think about it… Cheers :smiley:

github repo link
app link

How’s it going ace? I’m just starting to work on this project, so take what I say with a grain of salt.

Your app outputs a shortened url just like the FCC example does - essentially, it outputs an id number as a shortened url. If you enter that id number into the browser you do not get the page you are trying to link to. I have seen another example of this project that appends the id number to the end of a clickable url, making it much more convenient for the user. This is the model I am shooting for.

Hey thanks for the feedback… Yeah, I agree with you that it’s much more convenient for users to get a clickable URL, but I’ve only followed the specs from fCC example. If you’ve noticed, it’s pretty odd that you need to use http://base-url/api/shorturl/actualShortUrl format to go to saved original URL. Maybe I could save short URL as an integer in the database and then when creating a response to request, I could just combine it with http://base-url/api/shorturl/ and send that as a response.

Sure Ace, you’re doing it right. I’m having trouble implementing my idea, so I may need to re-evaluate at some point. This project would be a whole lot easier if we didn’t need to use a database. :wink:

If you get stuck, I would be glad to help you if I can… :wink:

https://www.freecodecamp.com/forum returns {“error”:“Invalid URL”} but this is a valid url I think so…

You’re right. It’s some kind of bug in the code. :man_shrugging:

Can you help me with this question: URL Shortener Microservice: multiple requests
Did you handle this case in your code?