

Hosting a Javascript website on github in Seconds for free - sravfeyn
http://divinequantum.blogspot.com/2012/02/hosting-web-app-on-github-in-seconds.html

======
catshirt
this is github pages. it is neither new nor unknown. move along please.

first four paragraphs are a personal anecdote, and the last 2 are a
regurgitation of the official github pages documentation, which the author
links to.

------
mise
Is it sustainable for GitHub to host (static) sites for free?

~~~
sravfeyn
Github already hosts lot of code and allows free downloads. By hosting a
static site, we essentially are hosting an HTML file which can be downloaded.
Unless the site is of very High traffic, it is already sustainable for
Github.Consider for example the amount of users who download Bootstrap from
Github everyday.

~~~
rictic
re: high traffic. A buddy and I hosted the static parts of our privacy
activism page youropenbook on github pages (it was initially all static). This
was during the privacy scandal of spring 2010 and as our traffic really ramped
up we sent a message to the github folks to see if they minded at all.

They gave the go ahead.

We served millions of pageviews, had a significant impact on the debate at the
time, and github pages took it like a champ.

------
clarle
This will effectively limit you to making requests to services that provide an
API that supports JSONP. If you're going to do something like this, why not
just use Heroku or something similar? Unless you're relying solely on external
APIs, you're going to need some server space sooner or later.

Github is good for static pages, like blogs, but I don't think a web
application will work that well.

~~~
MatthewPhillips
If you're willing to limit yourself to browsers that support CORS it's not an
issue. I would personally get a VPS from prgmr.com but for an experiment
GitHub is fine.

------
zackzackzack
I have a side project where I want to figure out how to host a database on
github. If there was a javascript API for doing git business on github, then
could just update the database to and fro. It would be messy of course but it
wouldn't matter. Because you would have a dynamic app up on github for free
(or 7/month if you wanted your secret sauce to stay secret).

~~~
ericktai
Not sure if you meant having an HTML/JS app served from GitHub with database
capabilities, but maybe you'd want to check out something like StackMob?
(Disclaimer, I work at StackMob, but appearing here as a fellow developer)

You can commit your HTML/JS files to GitHub and StackMob will serve those
pages for you via the GitHub integration StackMob has. What that enables you
to do is actually use StackMob's REST API for its backend services (datastore,
versioning, custom server side code) via AJAX since there's no cross-domain
AJAX problems (pages and ajax calls are going to/from your stackmob.com hosted
pages)

I use it to host my fiancee and I's wedding site and I use the datastore to
hold guest information, people can register/login etc. The data is stored on
Stackmob via the AJAX calls by using the JS SDK StackMob provides.

Example javascript:

var user = new StackMob.User({ username: 'asdf', password: 'asdf',
acquaintance: 'bride', ...}); user.create(); //this fires off the ajax call to
StackMob and saves your data in the datastore on that end.

It's free at a certain usage level (I'd imagine your personal use would be
within the free threshold) if you wanted to give it a go.

[https://www.stackmob.com/devcenter/docs/StackMob-Hosted-
HTML...](https://www.stackmob.com/devcenter/docs/StackMob-Hosted-
HTML5:-GitHub)

------
krondor
I moved my blog to it some time ago and it's been excellent so far. I do kind
of think this is out of scope for GitHub, and will probably move to S3 at some
point.

I did switch from Jekyll to Octopress though (Octopress is a nice framework
around Jekyll that automates the annoying manual bits involved with Jekyll).
So far it's been great though!

------
mise
If you have written a JavaScript library and it's hosted on GitHub, I wonder
if you can somehow include the `master` branch in your `gh-pages` branch as a
submodule. Do you get me? If the core repo is clean JS, but where your demo
site might want to include that JS, plus some extra pages.

~~~
sravfeyn
I would just point the script tag to the raw file address on github (eg.
<https://raw.github.com/sravfeyn/SparkDC/master/.download.py>), than using
github pages!

~~~
mise
Ah, nice.

------
sundar22in
You cannot access any arbitary website from Javascript.
<http://en.wikipedia.org/wiki/Same_origin_policy>

~~~
sravfeyn
While there is the same origin policy, there is mechanism to share some
resources as Matthew pointed out. Even if you host a site on domain ex1, you
can still access resource at google maps through API.

