var server = require("./server");
var router = require("./route");
var requestHandlers = require("./requestHandlers");

var debug = false; // todo move this to configfile

var handle = {}
handle["/"] = requestHandlers.sendInterface;
handle["/interface"] = requestHandlers.sendInterface;
handle["/js/jquery-1.12.1.min"] = requestHandlers.sendJquery;
handle["/js/jquery-ui.js"] = requestHandlers.sendJqueryUI;
handle["/css/bootstrap.min.css"] = requestHandlers.sendBootstrap;
handle["/sprite/emoji.ttf"] = requestHandlers.sendEmojiTtf;

handle["/clear"] = requestHandlers.sendClear;
if(server.demoMode()){
handle["/demo"] = requestHandlers.sendDemo;
}else{
  console.log("ERROR: Demo mode not active");
}


server.start(router.route,handle,debug);
