Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ var fs = require('fs');
var index = fs.readFileSync(__dirname + '/public/html/index.html');
var mainJs = fs.readFileSync(__dirname + '/public/js/main.js');
var mainCss = fs.readFileSync(__dirname + '/public/css/main.css');
var test = fs.readFileSync(__dirname + '/test/front-end/test.html');
var testJs = fs.readFileSync(__dirname + '/test/front-end/test.js');


var headersHtml = {
Expand All @@ -17,6 +19,17 @@ var headersCss = {
};


handler.test = function(req, res){
res.writeHead(200, headersHtml);
res.end(test);
};

handler.testJs = function(req, res){
res.writeHead(200, headersJs);
res.end(testJs);
};


handler.home = function(req, res){
res.writeHead(200, headersHtml);
res.end(index);
Expand Down
5 changes: 4 additions & 1 deletion router.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ var routes = {
'/main.js' : handler.mainJs,
'/main.css' : handler.mainCss,
'/index' : handler.index,
'/arrivalData' : tfl.handleArrivalDataRequests
'/arrivalData' : tfl.handleArrivalDataRequests,
'/testJs' : handler.testJs,
'/test' : handler.test


};

Expand Down