"use strict";

var fs = require('fs')
	, path = require('path')
	, connect = require('connect')
	, http = require('http')
	, KatsuStatic = require('./../index.js')
	, katsuStatic = new KatsuStatic({
		assetsDir: path.join(__dirname, 'assets')
	});

var index = fs.readFileSync(path.join(__dirname, 'index.html'));

var app = connect()
	.use('/assets/', katsuStatic.createServer())
	.use(function(req, res){
		res.writeHead(200, {'Content-Type': 'text/html'});
		res.end(index);
	});

http.createServer(app).listen(3000);
console.log('listening on :3000');