Live data from Hacker News

Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages

github.com

11–20 of 182 posts

Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages

#11
post #5

I was always fixated with URL shorteners and always wanted to write one myself. While it would be easy to write one that works with a server, I loved the idea of hosting and running one for free. Thus, I wrote this URL shortener which does not need a backend to work at all. It uses GitHub issues as a "database", and unlike most other URL shorteners that do not need backends, this one doesn't need a # prefixed to the…

That’s clever! I once did the same, except I used a static site generator that I would push to Github and deploy on Netlify.

I’d love to know more about how you did this!

Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages

#14
post #6

It's so cool. I am using https://git.io as url shortener, and now this project makes me reconsider. What if some of shortener domain so popular that Github takes some action? Like block or ban?

I would hope that the most they’d do is limit/throttle the number of new and updated issues. As long as the limit is very generous for a normal project, this sort of thing would still be supported at reasonable usage levels.

Hopefully it wouldn’t be considered abuse just by its nature (as opposed to any traffic spikes it might cause). Quite the reverse, this shows off the flexibility of the service!

Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages

#16
post #4

I was always fixated with URL shorteners and always wanted to write one myself. While it would be easy to write one that works with a server, I loved the idea of hosting and running one for free. Thus, I wrote this URL shortener which does not need a backend to work at all. It uses GitHub issues as a "database", and unlike most other URL shorteners that do not need backends, this one doesn't need a # prefixed to the…

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 loop was to supply the domain. That being said, I do appreciate the feedback and it's always great to learn more!

Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages

#19

Interesting. This could be considered as abuse of github issues though.

Indeed, especially with the recursive link created by someone else (nlsn.cf/6)

GitHub does have a 60 calls per hour API limit so I don't think it affects them as much(?) That being said this project is meant to be for fun and definitely not recommended for production purposes HAHA

Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages

#20
post #8

You 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?

It will redirect to the url.
Post reply on HN