From f07bf79826ee3012958fb1f2e19ecba34dafbf58 Mon Sep 17 00:00:00 2001 From: Marziyeh Ahmed Date: Sun, 21 Feb 2016 13:11:00 +0000 Subject: [PATCH] for saucelabs test --- handler.js | 13 +++++++++++++ router.js | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) 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 + };