From f00ba92ed2cc1a9c24ad783e83525d1b5a85b857 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Tue, 13 Sep 2016 11:43:06 +0200 Subject: Initial --- modules/subd-krokodil/subd-krokodil.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 modules/subd-krokodil/subd-krokodil.js (limited to 'modules/subd-krokodil') diff --git a/modules/subd-krokodil/subd-krokodil.js b/modules/subd-krokodil/subd-krokodil.js new file mode 100644 index 0000000..beabddd --- /dev/null +++ b/modules/subd-krokodil/subd-krokodil.js @@ -0,0 +1,21 @@ +var cmn=require("../$common.js"), + fs=require("fs"), + express=require("express"); + +module.exports=function(app,io,moddir){ + var router=express.Router(); + + router.use(function(req,res,next){ + next(); + }); + + router.get("/",function(req,res){ + res.sendFile(cmn.rootdir+"/web_files/krokodil.jpg"); + }); + + app.use(function(req,res,next){ + if(req.subdomains.length&&req.subdomains[req.subdomains.length-1]=="krokodil"){ + router.handle(req,res,next); + } else next(); + }); +}; -- cgit v1.2.3-70-g09d2