rearranging project layout
authorPaul J R <me@pjr.cc>
Sat, 22 Dec 2012 19:10:44 +0000 (06:10 +1100)
committerPaul J R <me@pjr.cc>
Sat, 22 Dec 2012 19:10:44 +0000 (06:10 +1100)
lib/webmain.js [moved from lib/purls/main.js with 100% similarity]
lib/wsrequest.js
purls/main_footer.js [moved from lib/purls/main_footer.js with 100% similarity]
purls/main_head.js [moved from lib/purls/main_head.js with 100% similarity]
purls/main_menu.js [moved from lib/purls/main_menu.js with 100% similarity]
purls/web_body.js [moved from lib/purls/web_body.js with 100% similarity]
purls/web_isbase.js [moved from lib/purls/web_isbase.js with 100% similarity]
purls/web_nobody.js [moved from lib/purls/web_nobody.js with 100% similarity]
purls/web_test.js [moved from lib/purls/web_test.js with 100% similarity]

similarity index 100%
rename from lib/purls/main.js
rename to lib/webmain.js
index c7797fc..021725b 100644 (file)
@@ -2,7 +2,7 @@ var url = require("url");
 var path = require("path");
 var fs = require("fs");
 var myparse = require("./myparse.js");
-var webmain = require("./purls/main.js");
+var webmain = require("./webmain.js");
 
 var staticExtensions = ["html", "gif", "jpg", "css", "js", "ico"];
 
@@ -43,7 +43,7 @@ function wsRequest(request, response) {
        }
 
        var thispurl = purl.pathname.split("/")[1];
-       fs.stat("./lib/purls/web_"+thispurl+".js", function (err, stats) {
+       fs.stat("./purls/web_"+thispurl+".js", function (err, stats) {
                console.log("get purl is "+thispurl+" and err "+err+" and "+stats);
                if(err) {
                        response.writeHead(404, {"Content-Type": "text/plain"});
@@ -51,7 +51,7 @@ function wsRequest(request, response) {
                        response.end();
                        return;
                }
-               var thiserv = require("./purls/web_"+thispurl+".js");
+               var thiserv = require("../purls/web_"+thispurl+".js");
                if(thiserv.requireBody()) {
                        console.log("yubber is true");
                        webmain.serveBody(request, response, thiserv.process);
similarity index 100%
rename from lib/purls/main_head.js
rename to purls/main_head.js
similarity index 100%
rename from lib/purls/main_menu.js
rename to purls/main_menu.js
similarity index 100%
rename from lib/purls/web_body.js
rename to purls/web_body.js
similarity index 100%
rename from lib/purls/web_isbase.js
rename to purls/web_isbase.js
similarity index 100%
rename from lib/purls/web_nobody.js
rename to purls/web_nobody.js
similarity index 100%
rename from lib/purls/web_test.js
rename to purls/web_test.js