added a method for setting resource path
[nodejsws.git] / lib / app.js
index 4fc59b0..7879fbc 100644 (file)
@@ -26,6 +26,14 @@ exports.setPurlPath = function(setpath) {
        global.njspurls.mainPath = mainpath;
 }
 
+exports.setResPath = function(setpath) {
+       // default purl path is set based on the module.parent if its relative
+       var basename = path.dirname(module.parent.filename);
+       var mainpath = path.resolve(basename, setpath);
+       console.log("setting res path to ", mainpath);
+       global.njspurls.mainResPath = mainpath;
+}
+
 exports.setFooterText = function(text) {
        global.njspurls.footerText = text;
 }