xinglinkedinenvelopebubblesgoogleplusfacebooktwitterfeedgithub

Hosting static web pages and assets with Google Drive

2nd February 2014 | by Adam Beres-Deak | google drive, hosting

Have you ever needed to quickly deploy a website somewhere? Maybe to show a client some demo content? Or to show a buddy your newest static web app? Here's the solution.

Google Drive officially supports hosting static files (like web pages and their assets). According to a discussion on Stack Exchange it doesn't violate the TOC when hotlinking these resources (free CDN?).

Here is what to do:

  1. Create a new folder in Google Drive
  2. Change its visibility options to: "Public on the web"
  3. Upload your files (html, css, js, images, swf, etc.)
  4. It's recommended to place an index.html file into the folder, which will be the default document in the directory
  5. Grab the URL of your folder (currently shown on the right under "HOSTING" when you select your newly created folder)
  6. There you go, just enter this URL into the browser. It should be something like https://googledrive.com/host/12345678901234567890abcd/
  7. You should be able to reference files directly inside that folder, e.g. https://googledrive.com/host/12345678901234567890abcd/css/main.min.css

Please note that this method is really meant to host static files. There is no support for backend code.

Resources

by Adam Beres-Deak

| Share | Tweet | Share | Share

Latest blog posts

Displaying icons with custom elements 14th October 2015

Plain JavaScript event delegation 26th January 2015

After the first year of blogging - what happened on my blog in 2014? 1st January 2015

Better webfont loading with using localStorage and providing WOFF2 support 18th December 2014

Worth watching: Douglas Crockford speaking about the new good parts of JavaScript in 2014 20th October 2014