Tuesday, February 21, 2012

Hosting a Web-App on github in Seconds

We are in an age, where every possible data about civilization is packed into APIs, often for free. There are APIs, to access a complete city, to access your social life, to access addresses on earth, to access movies, to access music, to access books, to access a hosted database. And in no minutes, one could build an awesome Javascript/AJAX application mashing up any of the APIs.

So, like everyone, I too have created apps based on APIs. The problem for someone like me is to get it online. I don't normally write the apps for money or ads. I write it for the hell of it. I write it, if it can solve a quick problem and be helpful to others, I write it for the joy. And I am just a student, I can't afford to spend my money to host a simple index.html with JS and CSS in it, on a web-server, and pay money each month.

So I was in search for a place in the clouds to put my tiny file. I tried hosting the apps using Google App Engine and others. The problem here is PRE-configuring a kind of virtual space given to us. Often, this is time-taking than building the app itself. 

And then I discovered awesomeness of github. I already use github to host my code. It lets anyone in the world to download those files without any authentication. So the natural idea was how about github hosting that index.html as a website rather than as a file. Though I never actually knew before this, that there is such thing as github pages, it is too trivial an idea to not to pass through my head. I searched for github hosting, and had been lead to discover github pages. 

The most amazing thing about hosting on github is you can get your app running, literally in SECONDS. It is as easy as forking a repo.
> Create a repo named username.github.com
> Commit your website to a file named index.html and push it to the master
Within a maximum of ten minutes http://{username}.github.com magically shows your web-app live. You can even host multiple web-apps and point it your own domain. Check out this minimal documentation for using github pages to get your app live. And if you want more custom templates, there is an awesome tool called Jekyll written by github folks.
  
Now, does github go down, NOT more than 1.28 minutes in a day. Does github respond slower, NO. Does github charge money, NO. does it take hours to set it up, NO, shit, in a couple of seconds I say. So, how about hosting your weekend projects on github. Be careful about the code visibility. And I already started hosting my http://instamovi.com on github at http://sravfeyn.github.com. I am gonna point github to the domain once my amazing friend's VPS expires.

14 comments:

  1. Thanks for letting me know about few new APIs.

    ReplyDelete
  2. Thanks! pages.github was a useful find

    ReplyDelete
  3. Boom. I was wondering what the deal was with twitter.github.com

    ReplyDelete
  4. Thank you so much for this! I'm so glad I checked Hacker News today.

    ReplyDelete
  5. sweet! Thanks for the tut... I see Motyar's already been here... :)

    ReplyDelete
  6. This comment has been removed by a blog administrator.

    ReplyDelete
  7. Once you use the github repo username.github.io how do you host other web-apps? Because in their tutorial for page [pages.github.com] it says that :

    "Head over to GitHub and create a new repository named username.github.io, where username is your username (or organization name) on GitHub. If the first part of the repository doesn’t exactly match your username, it won’t work, so make sure to get it right."

    So if I already have a repository username.github.io hosting one web-app, how and where do I host another web-app?

    ReplyDelete
  8. This comment has been removed by a blog administrator.

    ReplyDelete
  9. This really is therefore stunning as well as innovative. I simply adore the actual colours as well as whomever will get this within the postal mail is going to be grinning.
    http://melhor-hospedagem-de-sites.strikingly.com/

    ReplyDelete
  10. Delta Decisions Inc. is a premiere web development firm specializing in e-commerce and business websites. We offer services including website design, web hosting, SEO servives, pay-per-click, google adwords, website branding and much more.
    e-commerce Toronto

    ReplyDelete
  11. This is informative article of hosting , thanks for sharing...!
    seo services bangalore

    ReplyDelete
  12. Those links over there are now malware filled. Please revise.

    ReplyDelete
  13. Very helpful, thanks for sharing!

    ReplyDelete
  14. Your website is really cool and this is a great inspiring article. Thank you so much. skptricks

    ReplyDelete