You could also push static HTML pages to the git root which have, e.g., https://news.ycombinator.com/ '" /> in the header.
Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
31–40 of 182 posts
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#32I had this same ~dream of hosting a URL Shortener statically, which lead me to create URLZap. The difference is that it relies on a config file and it can be used on any code repository service https://github.com/brunoluiz/urlzap
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#333425 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
#34Brilliant. Works well. But 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
#35OP, how does this get around CORS?
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#36That is quite interesting. Only issue is to rely on Github Issues for it (it might get messy with too many issues opened). I had this same ~dream of hosting a URL Shortener statically, which lead me to create URLZap. The difference is that it relies on a config file and it can be used on any code repository service https://github.com/brunoluiz/urlzap
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#37Brilliant. Works well. But 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.
All redirection is client-side. Even 301s are just instructions for the client to open another page, which they are free to ignore.
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#38Since 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…
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#39There'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?
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#40Since 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…
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