summaryrefslogtreecommitdiff
path: root/modules/subd-krokodil/subd-krokodil.js
blob: b788863433ba684fba758698788f51dbfeda1b28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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.webfilesdir+"/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();
	});
};