It's easy to do it too, even if you use the API or not

Nov 29, 2012 10:21 GMT  ·  By

Google is making it possible to host simple websites by using your Google Drive account. The idea is to enable developers to create apps that make editing and publishing simple web pages accessible to everyone. But you don't need to use the Drive API to make use of the new features.

All you need to do is create a new Drive folder and share it publicly. Then upload some HTML file to that folder.

Any file uploaded here will be treated like a normal web host would treat it, index.html for example will be served automatically.

Basically, that's all there is to publishing a website on Google Drive. The trick is accessing that site, if you try to access the files from Google Drive, you'll just see the contents of the file.

You have to access this new site via https://googledrive.com/host/shared_folder_ID. This ID is visible when sharing the folder from the Drive app, it looks something like 0B716ywBKT84AcHZfMWgtNk5aeXM.

Using this URL will serve the file as it is, rather than open the Google Drive editor.

Any resources you need for the page, images, CSS files and so on will be retrieved as well, they just need to be added to the same folder using the appropriate relative paths.

You can even add JavaScript, so you can add quite a lot of interactivity to your site, as long as you don't need to rely on PHP, Python, MySQL or any other server-side resource.

Using a mixture of HTML5 and technologies like IndexedDB, those limitations aren't as bad as they might have been a few years ago.

If you'd like to know how to do this programmatically, which is what Google envisioned when it created the functionality, The Google Drive SDK documentation is a good place to start.

UPDATE: Google is making it more official with a guide to hosting a simple website on Google Drive.