summaryrefslogtreecommitdiff
path: root/modules/subd-krokodil/subd-krokodil.js
blob: beabddd4cf3722b4ce4c47f58ea9b9d85a1b4071 (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.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();
	});
};