Getting started with Swarm development.

First, get a copy of an up-to-date CannedData.dart so that you can work against relatively live data directly while running the app off of the local filesystem.

Put this file CannedData.dart in your working tree as

dart/samples/swarm/CannedData.dart

You should now be able to run your app out of your local filesystem for UI development using something like:

file:///Users/jimhug/dart-all/dart/samples/swarm/swarm.html
.

When you are ready to test your new UI on this live server, first you need to run

python update.py
from your
dart/samples/swarm
directory. This will build both a self-contained html file for both js and dart code. Then, use the link below to upload your files to this server. If you are uploading for testing, keep the version as shown and you will be able to access the js version at http://dart.googleplex.com/{{user.nickname}}-swarm-js.html. By submitting with no prefix, you will update the default demo version of the app.

Upload File:
Version:

Fully offline mode

Download CannedData.zip (right click, save as) and extract it to a location that your static file webserver serves. You'll want to run the following steps on Mac:

  1. In Sharing Preferences, enable Web Sharing.
  2. Open this file in a text editor:
    /private/etc/apache2/httpd.conf
  3. Find the code like this, change "Deny from all" to "Allow from all":
    	<Directory />
    	    Options FollowSymLinks
    	    AllowOverride None
    	    Order deny,allow
    	    Allow from all
    	</Directory>
    
            AddType text/html .data
    
  4. sudo apachectl restart
    pushd /Library/WebServer/Document
    # If you are replacing old data:
    # rm -rf data/
    unzip ~/Downloads/CannedData.zip
    chmod -R +rw data
    # Warning: this step takes a while
    # It downloads all images from all of the stories and inlines them in the HTML
    # You can skip this if you're iterating on the app, it's only needed for
    # "full offline" demo mode
    path/to/dart/dart/samples/swarm/cacheimages.py data/
    
  5. Download a copy of swarm-js.html from this server (or create with update.py) and save it as: /Library/WebServer/Document/index.html
  6. Try out your app at: http://localhost/

Development tools