The problem is appEngine itself. You are treating it as an object constructor by calling "new appEngine()" but appEngine is not a function, it is a plain object. You probably want to simply store the object in the application scope, like so:
// this is just so that we don't end up creating a global appEngine
// object via the include. We pass in an empty object, include uses
// it as the scope for the include instead of the global scope
// and then returns the populated scope. Also added
// $application.directory to avoid hard-coding the app folder name
var o=Myna.include($application.directory+"appEngine/appEngine.sjs",{})
$application.set("appEngine",o.appEngine);
NOTE:
You can take advantage of Myna.include's scoping behavior to write your libraries like this:
---------------- appEngine.sjs ----------------------
//functions become properties on the resulting object
function handleRequest() {
return false;
}
//this style works too
var doStuff = function(){
return "stuff done"
}
//any "var"d variable will become a property on the resulting object
var someObjectProperty = "woot!"
---------------- $application.sjs ----------------------
$application.set(
"appEngine",
Myna.include($application.directory+"appEngine/appEngine.sjs",{})
);
----------------------------------------------------------
Mark Porter
Myna JavaScript Application Server
Easy web development with server-side JavaScript
http://www.mynajs.org