re: - Open Source URL shortner VIEW POST

re: What made you go with a shortner that was JS powered? Since this method will make hitting "back" impossible.

Well we choose JS (specifically React) because

  1. it's easy to pick and use
  2. this webapp is computationally inexpensive, almost every client can run it

As the back button history, I don't see the issue. After you expand an URL where should you "go back to"? (or maybe you mean something else?)

Best regards :)


Consider a user on twitter interacting with a tweet that has a link from your site. Clicking on this link will result in an HTTP 200 response for the page which will then redirect to the next link in the chain, which will hopefully also return a 200.

Where as, if this was a server side app you would not return a 200 but a 301 making it so that when the user is on site B and hits “back then they would go back to twitter and not your app and get caught in an infinite loop.

Honestly, I did not think about it. But, if I recall correctly, with React-Router you can manage the browser history.
Do you have any tip?

PS: tried it on twitter/gmail and the default behaviour is to open my link on a new tab

you are correct and it does in fact actually work, that's my bad. in that case, making this server side would only increase load time, but cool project overall :)

Glad to know it works well! And thanks for your interest

code of conduct - report abuse