diff --git a/handler.js b/handler.js index ab5be63..1e7ed97 100644 --- a/handler.js +++ b/handler.js @@ -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 = { @@ -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); diff --git a/router.js b/router.js index 41f4c5f..2c6051b 100644 --- a/router.js +++ b/router.js @@ -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 + };