From a52b7b3949e5fc39611e8d5f0a8791efcc5a816e Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 3 Feb 2019 17:35:20 +0100 Subject: Move web_files to server folder --- modules/$common.js | 2 +- modules/subd-krokodil/subd-krokodil.js | 2 +- webserver.js | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/$common.js b/modules/$common.js index c5c3635..3d66042 100644 --- a/modules/$common.js +++ b/modules/$common.js @@ -5,8 +5,8 @@ var cwd=process.cwd(); var globalAccounts=require(cwd+"/globalAccounts.json"); module.exports={ - "rootdir":path.dirname(cwd), "serverdir":cwd, + "webfilesdir":cwd+"/web_files", "simpleHTMLescape":function simpleHTMLescape(str){ return str.replace(/&/g,'&').replace(//g,'>'); }, diff --git a/modules/subd-krokodil/subd-krokodil.js b/modules/subd-krokodil/subd-krokodil.js index beabddd..b788863 100644 --- a/modules/subd-krokodil/subd-krokodil.js +++ b/modules/subd-krokodil/subd-krokodil.js @@ -10,7 +10,7 @@ module.exports=function(app,io,moddir){ }); router.get("/",function(req,res){ - res.sendFile(cmn.rootdir+"/web_files/krokodil.jpg"); + res.sendFile(cmn.webfilesdir+"/krokodil.jpg"); }); app.use(function(req,res,next){ 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",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"); }); -- cgit v1.2.3-70-g09d2