2016-03-07 20:14:16 +00:00
|
|
|
// functions that will be executed when
|
|
|
|
// typeoff handle[pathname] === a function in requestHandlers.
|
|
|
|
// the handle and function are discribed in index.js
|
|
|
|
|
|
|
|
var fs = require('fs'),
|
|
|
|
server = require('./server');
|
|
|
|
|
|
|
|
function sendInterface(response) {
|
|
|
|
console.log("Request handler 'interface' was called.");
|
|
|
|
response.writeHead(200, {"Content-Type": "text/html"});
|
2016-03-07 20:48:50 +00:00
|
|
|
var html = fs.readFileSync(__dirname + "/board.html")
|
2016-03-07 20:14:16 +00:00
|
|
|
response.end(html);
|
|
|
|
}
|
|
|
|
|
2016-03-15 10:22:03 +00:00
|
|
|
function sendEmojiCss(response) {
|
|
|
|
console.log("Request handler 'Emojicss' was called.");
|
2016-03-15 09:42:21 +00:00
|
|
|
response.writeHead(200, {"Content-Type": "text/css"});
|
|
|
|
var html = fs.readFileSync(__dirname + "/served/emoji.css")
|
|
|
|
response.end(html);
|
|
|
|
}
|
2016-03-15 10:22:03 +00:00
|
|
|
|
|
|
|
function sendEmojiPng(response) {
|
|
|
|
console.log("Request handler 'Emojipng' was called.");
|
2016-03-15 09:42:21 +00:00
|
|
|
response.writeHead(200, {"Content-Type": "image/png"});
|
|
|
|
var html = fs.readFileSync(__dirname + "/served/emoji.png")
|
|
|
|
response.end(html);
|
|
|
|
}
|
|
|
|
|
2016-03-15 10:22:03 +00:00
|
|
|
function sendBootstrap(response) {
|
|
|
|
console.log("Request handler 'css' was called.");
|
|
|
|
response.writeHead(200, {"Content-Type": "text/css"});
|
|
|
|
var html = fs.readFileSync(__dirname + "/served/bootstrap.min.css")
|
|
|
|
response.end(html);
|
|
|
|
}
|
|
|
|
|
|
|
|
function sendJquery(response) {
|
|
|
|
console.log("Request handler 'jquery' was called.");
|
|
|
|
response.writeHead(200, {"Content-Type": "application/javascript"});
|
|
|
|
var html = fs.readFileSync(__dirname + "/served/jquery-1.12.1.min.js")
|
|
|
|
response.end(html);
|
|
|
|
}
|
|
|
|
|
|
|
|
function sendJqueryUI(response) {
|
|
|
|
console.log("Request handler 'jqueryUI' was called.");
|
|
|
|
response.writeHead(200, {"Content-Type": "application/javascript"});
|
|
|
|
var html = fs.readFileSync(__dirname + "/served/jquery-ui.js")
|
|
|
|
response.end(html);
|
|
|
|
}
|
|
|
|
|
2016-03-15 12:21:33 +00:00
|
|
|
function sendClear(response) {
|
|
|
|
console.log("Request handler 'clear' was called.");
|
|
|
|
response.writeHead(200, {"Content-Type": "text/html"});
|
2016-06-28 18:15:57 +00:00
|
|
|
var html = fs.readFileSync(__dirname + "/clear.html");
|
2016-03-15 12:21:33 +00:00
|
|
|
response.end(html);
|
|
|
|
}
|
|
|
|
|
2016-06-28 18:15:57 +00:00
|
|
|
function sendDemo(response) {
|
|
|
|
console.log("Request handler 'demo' was called.");
|
|
|
|
response.writeHead(200, {"Content-Type": "text/html"});
|
|
|
|
var html = fs.readFileSync(__dirname + "/demo.html");
|
|
|
|
response.end(html);
|
|
|
|
}
|
2016-03-15 12:21:33 +00:00
|
|
|
|
|
|
|
exports.sendClear = sendClear;
|
2016-06-28 18:15:57 +00:00
|
|
|
exports.sendDemo = sendDemo;
|
2016-03-15 12:21:33 +00:00
|
|
|
|
2016-03-15 10:22:03 +00:00
|
|
|
|
|
|
|
exports.sendBootstrap = sendBootstrap;
|
|
|
|
exports.sendJqueryUI = sendJqueryUI;
|
|
|
|
exports.sendJquery = sendJquery;
|
|
|
|
exports.sendEmojiPng = sendEmojiPng;
|
|
|
|
exports.sendEmojiCss = sendEmojiCss;
|
2016-03-07 20:14:16 +00:00
|
|
|
exports.sendInterface = sendInterface;
|