Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
21–30 of 182 posts
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#22You could also push static HTML pages to the git root which have, e.g., https://news.ycombinator.com/ '" /> in the header.
I am not familiar with this, could you explain what will happen?
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#23Interesting. This could be considered as abuse of github issues though.
It is an artistic and creative way to shorten urls, but likely won’t exist forever. As long as it does though, we can appreciate the art for what it is.
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#24Earlier quoted context omitted.
Looks nice and simple! Bit strange to claim "there is no database" and then add "GitHub issues is the database", maybe add "there is no traditional RDMS/document database needed" or something similar. You might want to detect infinite loops as well :) https://nlsn.cf/6 Last note, the status code seems to be incorrectly set to 404 instead of any of the redirection status code. If you're hosting it on GitHub pages, I'm…
HAHA so that was you. That was a good one! Yes and that title is definitely slightly misleading I kinda didn't want it to get so long and wanted that slight clickbait effect. Yep I actually cannot control the status code at all. Part of what made this a fun and hacky project was the fact that I was actually redirecting to the actual URLs by catching the 404s. So, the only way i could think of catching the infinite lo…
I think you could catch the infinitive loop client-side as well by comparing what the URL to redirect to is, and comparing it with the current URL. If they are the same, prevent the redirect. Although you would still be able to create loops by using two issues instead. Maybe just comparing the full hostname? If it's nlsn.cf, don't redirect.
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#253425 lines in package-lock.json for a "Minimal URL shortener" https://github.com/nelsontky/gh-pages-url-shortener/blob/mai...
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#26it does need a database though. it just uses someone else's database
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#27> Unlike many URL shorteners, this one does not need a database and can be entirely hosted on GitHub pages. it does need a database though. it just uses someone else's database
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#28But this has a chance of not working since you are doing the redirection client-side. Some addons block 3rd party resources. Looks like you're using the github API and sending the request from the user's browser.
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#29Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#301. I looked at https://github.com/nelsontky/gh-pages-url-shortener/blob/mai... and it is a basic script that does nothing more than redirection. A lot of URL shorteners on the web do a lot more. Premium ones can track users and route links based on client.
2. Most of URL shortening audience is non-technical and they usually like to pay and forget about it. Hosting and running your own service is an overhead.
3. Handling traffic at scale is challenging. So, if you have a lot of hits, I would not advise spending time maintaining the service.
4. Github can kill this anytime.
That said, this is neat solution for basic needs.