typescript-play icon indicating copy to clipboard operation
typescript-play copied to clipboard

feature request: short links

Open trusktr opened this issue 7 years ago • 4 comments

It'd be nice to have the option to request a short link at the click of a button (shorter than just the encoded value of the code).

Also a cool feature would be custom URLs, similar to like what http://bit.do does.

Even though these URLs are currently shorter than TypeScript's playground URLs, they are still to long for comments on StackOverflow.

trusktr avatar Nov 01 '18 23:11 trusktr

@trusktr I don't really want to do a backend with storage for this one, do you maybe know any short link API that can be used for this?

agentcooper avatar Dec 05 '18 21:12 agentcooper

One possible solution I can come up with is to use a free web service like Firebase as the storage.

pengx17 avatar Dec 21 '18 10:12 pengx17

You can avoid a database by using a static file. You might be able to use the GitHub API to dynamically update the file and kick off a build when it’s modified. Netlify has a way to handle redirects that I’m using here:

https://github.com/ceriously/go.ceriously.com

styfle avatar Dec 21 '18 16:12 styfle

I've used the approach of using Github APIs to trigger a PR and then a build & deploy on merge as a database replacement before as it gave me a UI for reviewing the changes out of the box too. I would not recommend using such an approach here — it's way too slow for an interaction where the user expects his shortened URL to work instantly. Not to mention that with higher usage frequencies this will quickly run into scaling issues as Github will for sure rate limit you.

Airblader avatar Jan 18 '19 21:01 Airblader