Live data from Hacker News

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

github.com

41–50 of 182 posts

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

#42

3425 lines in package-lock.json for a "Minimal URL shortener" https://github.com/nelsontky/gh-pages-url-shortener/blob/mai...

I always wondered if relying so much on external libraries in the long run is more hassle to maintain than doing it by yourself. Security updates will be provided for X major version for a reasonable amount of time, but afterwards you will have to update, check that nothing breaks and update your code as well. Also some of the deps will break regardless of SemVer and you will need to update.

Sadly, its a lost cause. The result is [left-pad](https://www.theregister.com/2016/03/23/npm_left_pad_chaos/).

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

#43
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 reckon it'll be possible to "simplify" it even more for an end-user, by making a static site generator generate these redirect HTML files from markdown or a CSV.

Some guy shared his project in this post that does exactly that! Yes while that is possible and can get to a high level of automation via GitHub actions, the point of my URL shortener was more of people could post a link easily with a simple interface (like the interface for adding a new issue). But if I were operating with a fixed set of short links, then this would have been a good method!

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

#44
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.

Yeah I suspect you could do something nifty along these lines with Netlify Functions.

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

#45

There's a lot of useful stuff to learn from this tiny example, providing you look at it more as a learning exercise than a production enterprise solution! OP, how does this get around CORS?

The github api does not care about your origin so that wasn't something I had to deal with! If I had to deal with something like that, my best option would be to use a proxy server, which would arguably negate the whole point of this "serverless" hack.

Your browser should, though. I would expect the fetch() request from nlsn.cf to github.com to throw a security error — presumably, the way custom domains are handled on github pages includes the addition of the custom domain as a trusted source at the github end.

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

#46

Since I am running a URL shortener service https://blanq.io , my two cents: 1. 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 fo…

I don't think this is meant to be used by anyone, except as a fun proof-of-concept project, or maybe for a personal collection of URLs.

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

#48

Since I am running a URL shortener service https://blanq.io , my two cents: 1. 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 fo…

How come I couldn’t find your service when I was looking for alternatives for bitly? The only results I got via Google, product hunt ... services that were overpriced and very limiting (nr of teammates)

I launched this a few months ago so getting to the first page of google search results is a bit challenging.

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

#49

Since I am running a URL shortener service https://blanq.io , my two cents: 1. 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 fo…

1. What's wrong with a "basic" script? 2. who "likes to pay"? Having a free option is great, no matter whether you're "non-technical" or not... 3. It's hosted on GH Pages. I think they're pretty okay on the scaling front, what do you think? 4. Technically yes, as in "they could switch off GH Pages and the API". Not sure how likely that is. Also, the redirections are saved as GH issues

1. Nothing wrong. But there are plenty of things to consider if you need a mature product.

2. Businesses like to pay.

3. Github has been bad lately https://www.theregister.com/2020/07/13/github_takes_some_dow...

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

#50

Since I am running a URL shortener service https://blanq.io , my two cents: 1. 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 fo…

Yes I agree with all of the above. And with my fixation on URL shorteners, I did have a dream of creating a full fledged URL shortening service like yours. I wasn't technically skilled enough for that then and thus didn't do it but your site does look great!
Post reply on HN