
var cgi = require('juice/engine/cgi');

function application(env) {
  return [
    200,
    {contentType: 'text/html'},
    function() {
      yield "Hi!";
      yield "<h2>Title</h2>";
      yield "<b>Hi!</b>";
      yield "<pre>Script url args are " + env.PATH_INFO + "</pre>";
      yield "<pre>This script is rooted at " + env.SCRIPT_NAME + "</pre>";
      yield "<h2>Title \u2603</h2>";
    }
  ];
}

cgi.run(application);

@@ -1,69 +1,36 @@
 %0A
-var cgi = require('juice/engine/cgi');%0A%0Afunction application(env
+function doneChore(env, task_id
 ) %7B%0A
@@ -102,57 +102,8 @@
 ) %7B%0A
-      yield %22Hi!%22;%0A      yield %22%3Ch2%3ETitle%3C/h2%3E%22;%0A
     
@@ -319,29 +319,141 @@
  %5D;%0A
+%0A
 %7D%0A%0A
-cgi.run(application
+var juice = require('lib/juice');%0A%0Avar app = new juice.Application;%0A%0Aapp.actions = %7B%0A  %22/done/(%5C%5Cd+)%22: doneChore%0A%7D;%0A%0Ajuice.run(app
 );%0A

Use the new dispatcher framework