commenting example code
[nodejsws.git] / examples / simple / myapp.js
index 7eed9ea..ae2ac7f 100644 (file)
@@ -1,12 +1,36 @@
+// require the main njspurls module
 var app = require("njspurls");
 
+// below we set a bunch of things globally for the app
+// set the port to listen to
 app.setPort(8888);
+
+// location for loading "purls" - this is the default
 app.setPurlPath("./purls");
+
+// location for static resources - default
+app.setResPath("./res");
+
+// purl to load for main page, i.e. /
+// this will search for main.js from purls/ (this is the default)
+// note - if none is provided, it defaults to layouts from layouts.js
 app.setDefaultMainPurl("main");
-app.addMenu("name1", "/linkto1");
-app.addMenu("name2", "/linkto2");
-app.addMenu("name3", "/linkto3");
+
+// add some menu items for the default menu builder - a simple menu
+// building mechanism which creates an array in global that can then be
+// rendered via the layout.menu function
+app.addMenu("Home", "/");
+app.addMenu("SimpleLayout", "/simplelayout");
+app.addMenu("LayoutOnly", "/justlayout");
+
+// default name for the application. Used by default section
+// builders where a name is required
 app.setAppName("MyExampleApp");
+
+// set some default footer text (typically a copyright notice or something)
 app.setFooterText("<br><br><font size=\"-2\"><i>Copyright PJR.cc 2012 &copy;</i></font>");
 
+
+// now start the application
 app.start();
+