commenting example code
[nodejsws.git] / examples / simple / myapp.js
1 // require the main njspurls module
2 var app = require("njspurls");
3
4 // below we set a bunch of things globally for the app
5 // set the port to listen to
6 app.setPort(8888);
7
8 // location for loading "purls" - this is the default
9 app.setPurlPath("./purls");
10
11 // location for static resources - default
12 app.setResPath("./res");
13
14 // purl to load for main page, i.e. /
15 // this will search for main.js from purls/ (this is the default)
16 // note - if none is provided, it defaults to layouts from layouts.js
17 app.setDefaultMainPurl("main");
18
19 // add some menu items for the default menu builder - a simple menu
20 // building mechanism which creates an array in global that can then be
21 // rendered via the layout.menu function
22 app.addMenu("Home", "/");
23 app.addMenu("SimpleLayout", "/simplelayout");
24 app.addMenu("LayoutOnly", "/justlayout");
25
26 // default name for the application. Used by default section
27 // builders where a name is required
28 app.setAppName("MyExampleApp");
29
30 // set some default footer text (typically a copyright notice or something)
31 app.setFooterText("<br><br><font size=\"-2\"><i>Copyright PJR.cc 2012 &copy;</i></font>");
32
33
34 // now start the application
35 app.start();
36