diff options
author | tomsmeding <tom.smeding@gmail.com> | 2019-02-03 17:35:20 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2019-02-03 17:35:20 +0100 |
commit | a52b7b3949e5fc39611e8d5f0a8791efcc5a816e (patch) | |
tree | a8c2a3ba8ff8b8fe4bc0eec269e040d0b4c03e5d /webserver.js | |
parent | 683f35ac44f725c6ea4276e4042b3a5d424776a8 (diff) |
Move web_files to server folder
Diffstat (limited to 'webserver.js')
-rwxr-xr-x | webserver.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/webserver.js b/webserver.js index ab524ca..319f392 100755 --- a/webserver.js +++ b/webserver.js @@ -77,7 +77,7 @@ for(i=0;i<module_list.length;i++){ function requestFile(req,res,listdirs,path,origpath){ - fname=cmn.rootdir+"/web_files"+path; + fname=cmn.webfilesdir+path; console.log("Requesting file "+fname); if(!fs.existsSync(fname)){ res.status(404).send("That file does not exist."); @@ -158,32 +158,32 @@ app.get("/google*.html",function(req,res){ ["o","k","rip","rip2"].forEach(function(target){ app.get("/"+target,function(req,res){ - res.sendFile(cmn.rootdir+"/web_files/"+target+".html"); + res.sendFile(cmn.webfilesdir+"/"+target+".html"); }); app.get("/"+target+"/*",function(req,res){ res.set('Content-Type', 'text/html'); res.send( - String(fs.readFileSync(cmn.rootdir+"/web_files/"+target+".html")) + String(fs.readFileSync(cmn.webfilesdir+"/"+target+".html")) .replace("<!--MESSAGEMESSAGE-->",cmn.simpleHTMLescape(url.parse(req.url).pathname.slice(target.length+2))) ); }); }); app.get("/dr",function(req,res){ - res.sendFile(cmn.rootdir+"/web_files/duckroll.html"); + res.sendFile(cmn.webfilesdir+"/duckroll.html"); }); app.get(["/gpg","/pgp","/gpg.asc","/pgp.asc"],function(req,res){ res.type("text/plain"); - res.sendFile(cmn.rootdir+"/web_files/pgp.asc"); + res.sendFile(cmn.webfilesdir+"/pgp.asc"); }); app.get("/tomsg",function(req,res){ - res.sendFile(cmn.rootdir+"/web_files/tomsg.html"); + res.sendFile(cmn.webfilesdir+"/tomsg.html"); }); app.get("/goioi",function(req,res){ - res.sendFile(cmn.rootdir+"/web_files/goioi.html"); + res.sendFile(cmn.webfilesdir+"/goioi.html"); }); |