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:
- Create a new folder in Google Drive
- Change its visibility options to: "Public on the web"
- Upload your files (html, css, js, images, swf, etc.)
- It's recommended to place an index.html file into the folder, which will be the default document in the directory
- Grab the URL of your folder (currently shown on the right under "HOSTING" when you select your newly created folder)
- There you go, just enter this URL into the browser. It should be something like
https://googledrive.com/host/12345678901234567890abcd/
- 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
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