rearranging project layout
[nodejsws.git] / lib / wsrequest.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);