new request layout bits
[nodejsws.git] / lib / app.js
diff --git a/lib/app.js b/lib/app.js
new file mode 100644 (file)
index 0000000..07718dc
--- /dev/null
@@ -0,0 +1,36 @@
+
+var http = require("http"),
+    url = require("url"),
+    path = require("path"),
+    fs = require("fs"),
+    req = require("./wsrequest.js"),
+    localPort = 8888,
+    defaultLayout = "standard",
+    defaultMain = null;
+
+
+
+
+
+exports.setPort = function(port) {
+       localPort = port;
+}
+
+exports.start = function() {
+       // initialise req
+       req.setDefaultLayout(defaultLayout);
+       req.setDefaultMain(defaultMain);
+       
+       
+       http.createServer(req.wsRequest).listen(localPort);
+
+       console.log("Server running on port: ", localPort);
+}
+
+exports.setDefaultLayout = function(layout) {
+       defaultLayout = layout;
+}
+
+exports.setDefaultMain = function(main) {
+       defaultMain = main;
+}
\ No newline at end of file