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)
Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
61–70 of 182 posts
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#62Earlier quoted context omitted.
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.
It should, in the right circumstances. By default, CORS dictates that cross-origin requests should not be allowed.
But sometimes you want that to be possible, so we have headers available to is where we can signal which domains are allowed to access the origin when on another origin.
In the case of the GitHub API, they (GitHub) are setting these headers to allow any origin to access the GitHub API from any other origin, that's why your browser doesn't throw a security error. Check out the various "access-control-*" headers the GitHub API returns as response headers when you use it.
It has nothing to do with custom domains or GitHub Pages, but all to do with CORS and associated headers. You can learn more about CORS here: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#63Earlier quoted context omitted.
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
#64Earlier quoted context omitted.
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.
Access-Control-Allow-Origin: star
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#65Earlier quoted context omitted.
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.
The Github API has CORS setup to allow requests from everywhere. This has nothing to do with being hosted on GitHub Pages.
I know perfectly fine what you mean here, but in the name of security, it's important to be precise.
All websites and browsers have CORS, one way or another, as CORS is the general concept. By default, only "same-origin" requests are allowed and "cross-origin" requests are disabled. But CORS is still there none the less.
What GitHub has done in this case, is add support for "cross-origin" requests.
Nitpicky maybe, but thought it'd be useful to add to avoid any confusion.
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#66Since 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
#67Earlier quoted context omitted.
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.
> Your browser should, though It should, in the right circumstances. By default, CORS dictates that cross-origin requests should not be allowed. But sometimes you want that to be possible, so we have headers available to is where we can signal which domains are allowed to access the origin when on another origin. In the case of the GitHub API, they (GitHub) are setting these headers to allow any origin to access the…
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#68Since 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 think the example on your home page would look better as https://mysto.re/buy-shoes https://en.wikipedia.org/wiki/.re
Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#69Re: Show HN: I created a URL shortener that can be entirely hosted on GitHub Pages
#70> 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