2
1
mirror of https://github.com/s00500/nodeMessageBoard.git synced 2025-07-13 00:11:00 +00:00

Added server and Interface structure

This commit is contained in:
2016-03-07 21:14:16 +01:00
parent f4b1da0e1f
commit 76cc6c6d6a
6 changed files with 350 additions and 16 deletions

15
requestHandlers.js Normal file
View File

@ -0,0 +1,15 @@
// 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"});
var html = fs.readFileSync(__dirname + "board.html")
response.end(html);
}
exports.sendInterface = sendInterface;