var http = require('helma/httpserver');
http.start({
    port: 8080,
    moduleName: 'jack/narwhal',
    functionName: 'Narwhal'
});

// Alternatively, you can pass the jack app to start() as second argument.
// this bypasses module loading in the servlet, so changes in the Jack app won't be picked up.
// http.start({ port: 8080 }, require('jack/narwhal').Narwhal);

@@ -1,8 +1,101 @@
+try %7B%0A%0A    // fail fast if no jack libs on the module path%0A    require('jack/narwhal');%0A%0A    
 var http
@@ -126,16 +126,20 @@
 rver');%0A
+    
 http.sta
@@ -147,16 +147,20 @@
 t(%7B%0A    
+   
+ 
 port: 80
@@ -163,16 +163,20 @@
 : 8080,%0A
+    
     modu
@@ -199,16 +199,20 @@
 rwhal',%0A
+    
     func
@@ -235,13 +235,21 @@
 al'%0A
+    
 %7D);%0A%0A
+    
 // A
@@ -319,16 +319,20 @@
 gument.%0A
+    
 // this 
@@ -418,16 +418,20 @@
 ked up.%0A
+    
 // http.
@@ -486,8 +486,187 @@
 rwhal);%0A
+%0A%7D catch (error) %7B%0A    print();%0A    print(%22Can't start Jack demo. Make sure you have Jack installed and configured as described in README.txt.%22);%0A    print();%0A    print(error);%0A%7D%0A

Print message and exit if jack libs can't be loaded.