Deploying your app via DropBox

Note: The problems that DropBox had which affected this method were fixed on Jan 28, 2013. Everything is working again!

Looking for a way to make your apps available to the world without getting your own website? DropBox could be the answer: best of all, it doesn’t cost anything.

DropBox, if you haven’t used it, lets you put a directory of files from your system in the cloud. To you, it just looks like another directory on your PC or Mac. Behind the scenes, the content of the directory is mirrored on DropBox’s servers. Where it gets really cool is that you can have that same directory on other computers – yours or your friends. Sign up is free, and you’ll get a couple of gigs of storage.

One of the guys here was hacking on DropBox and discovered that it serves up the .appcache filetype with the proper MIME extension for HTML5 caching. That suddenly made DropBox much more useful to App Studio users: You can deploy apps to DropBox and they will load properly and run.

The final piece fell in place a few weeks ago when DropBox added public folders. You can now have a folder in your DropBox directory that the whole world can read files from. This means you can use DropBox as a server to host your apps.

Before I go into the details of how to do this, I need to note one restriction: there is no server side processing. If you need to use PHP scripts or AJAX calls to the server, DropBox won’t work for you.

Here’s how to use Dropbox to deploy apps:

  1. Get AppStudio 3. You’ll need the full version: this cannot be done with the demo.
  2. Create a Public folder in your DropBox account. https://www.dropbox.com/enable_public_folder.
  3. Go into Tools…Deploy Options. Select “Deploy to local or DropBox public folder” and put the path of your DropBox into Local Path:

    deploydropbox

  4. Deploy your app (F6). All the files needed for deployment will be saved in a folder with the app’s name, in your DropBox Public folder.
  5. Get the public address. Open DropBox in your web browser. Navigate to your app in the Public folder and right click on the index.html file. Choose ‘Copy Public Link’
  6. Now copy the link that appears and give this to people who want to run your app.
  7. Go ahead: try it!

    http://dl.dropbox.com/u/4451197/HelloWorld/index.html

A couple of closing notes:

  1. While AppStudio will deploy the project to your Public folder almost instantly (it’s on your local system), it will take a bit of time for the files to the copied to your folder on DropBox’s site. You won’t be able to run your app from DropBox’s site until all the files are there.
  2. This same technique can be used on DropBox folder other than Public. You can then share apps with only a restricted list of people.
  3. Make sure that ‘manifestFile’ in Project Properties is set to ‘appcache’.
  4. The DropBox Public folder does everything that nsbapp.com does. DropBox has the advantage that you have full control over your files. Apps on nsbapp.com get deleted automatically if they have not been updated for a while (currently 6 months).