var http = require('http');
var fs = require('fs');

var server = http.createServer(function (req, res) {
	if(req.url === '/lib/anthStats.js') {
		res.setHeader("Content-Type", "application/x-javascript")
		fs.createReadStream(__dirname + '/../lib/anthStats.js').pipe(res);
		return;
	}

	if(/^\/(index.html)?/.test(req.url)) {
		res.setHeader("Content-Type", "text/html")
		fs.createReadStream(__dirname + '/static/index.html').pipe(res);
		return;
	}

	if(/^\/stat/.test(req.url)) {
		console.log("Got stat: ", req.url);

		res.setHeader("Content-Type", "image/jpeg")
		res.end();
		return;
	}
});
server.listen(8000);

console.log('Listening for request:');

@@ -197,16 +197,17 @@
 script%22)
+;
 %0A%09%09fs.cr
@@ -294,21 +294,12 @@
 /%5E%5C/
-(index.html)?
+stat
 /.te
@@ -309,24 +309,63 @@
 req.url)) %7B%0A
+%09%09console.log(%22Got stat: %22, req.url);%0A%0A
 %09%09res.setHea
@@ -389,84 +389,32 @@
 %22, %22
-text/html
+image/jpeg
 %22)
+;
 %0A%09%09
-fs.createReadStream(__dirname + '/static/index.html').pipe(res
+res.end(
 );%0A%09
@@ -426,36 +426,45 @@
 rn;%0A%09%7D%0A%0A%09if(/%5E%5C/
-stat
+(index.html)?
 /.test(req.url))
@@ -470,47 +470,8 @@
 ) %7B%0A
-%09%09console.log(%22Got stat: %22, req.url);%0A%0A
 %09%09re
@@ -503,31 +503,85 @@
 %22, %22
-image/jpeg
+text/html
 %22)
+;
 %0A%09%09
-res.end(
+fs.createReadStream(__dirname + '/static/index.html').pipe(res
 );%0A%09
@@ -592,16 +592,17 @@
 urn;%0A%09%7D%0A
+%0A
 %7D);%0Aserv

fix server response mime