Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
chore(deps): update various npm dependencies to latest stable releases
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 authored and juliemr committed Jan 22, 2016
1 parent 3c94d72 commit 5930d14
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,26 @@
],
"author": "Julie Ralph <ju.ralph@gmail.com>",
"dependencies": {
"request": "~2.57.0",
"request": "~2.67.0",
"selenium-webdriver": "2.48.2",
"jasminewd2": "0.0.6",
"jasmine": "2.3.2",
"jasmine": "2.4.1",
"saucelabs": "~1.0.1",
"glob": "~3.2",
"adm-zip": "0.4.4",
"glob": "~6.0",
"adm-zip": "0.4.7",
"optimist": "~0.6.0",
"q": "1.0.0",
"source-map-support": "~0.3.2"
"q": "1.4.1",
"source-map-support": "~0.4.0"
},
"devDependencies": {
"expect.js": "~0.2.0",
"chai": "~3.3.0",
"chai-as-promised": "~5.1.0",
"jshint": "2.5.0",
"mocha": "2.3.3",
"express": "~3.3.4",
"rimraf": "~2.2.6"
"expect.js": "~0.3.1",
"chai": "~3.4.1",
"chai-as-promised": "~5.2.0",
"jshint": "2.9.1",
"mocha": "2.3.4",
"express": "~4.13.3",
"body-parser": "1.14.2",
"rimraf": "~2.5.0"
},
"repository": {
"type": "git",
Expand Down
32 changes: 15 additions & 17 deletions testapp/scripts/web-server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node

var express = require('express');
var bodyParser = require('body-parser')
var optimist = require('optimist');
var util = require('util');
var path = require('path');
Expand All @@ -21,6 +22,10 @@ var angularDir = path.join(testAppDir, 'ng1/lib/angular_v' + argv.ngversion);

var main = function() {
var port = argv.port;
testApp.use('/ng1/lib/angular', express.static(angularDir));
testApp.use(express.static(testAppDir));
testApp.use(bodyParser.json());
testApp.use(testMiddleware);
testApp.listen(port);
util.puts(["Starting express web server in", testAppDir ,"on port", port].
join(" "));
Expand All @@ -29,52 +34,45 @@ var main = function() {
var storage = {};
var testMiddleware = function(req, res, next) {
if (/ng[1-2]\/fastcall/.test(req.path)) {
res.send(200, 'done');
res.status(200).send('done');
} else if (/ng[1-2]\/slowcall/.test(req.path)) {
setTimeout(function() {
res.send(200, 'finally done');
res.status(200).send('finally done');
}, 5000);
} else if (/ng[1-2]\/fastTemplateUrl/.test(req.path)) {
res.send(200, 'fast template contents');
res.status(200).send('fast template contents');
} else if (/ng[1-2]\/slowTemplateUrl/.test(req.path)) {
setTimeout(function() {
res.send(200, 'slow template contents');
res.status(200).send('slow template contents');
}, 5000);
} else if (/ng[1-2]\/chat/.test(req.path)) {
if (req.method === 'GET') {
var value;
if (req.query.q) {
value = storage[req.query.q];
res.send(200, value);
res.status(200).send(value);
} else {
res.send(400, 'must specify query');
res.status(400).send('must specify query');
}
} else if (req.method === 'POST') {
if (req.body.key == 'newChatMessage') {
if (!storage['chatMessages']) {
storage['chatMessages'] = [];
}
storage['chatMessages'].push(req.body.value);
res.send(200);
res.sendStatus(200);
} else if (req.body.key == 'clearChatMessages') {
storage['chatMessages'] = [];
res.send(200);
res.sendStatus(200);
} else {
res.send(400, 'Unknown command');
res.status(400).send('Unknown command');
}
} else {
res.send(400, 'only accepts GET/POST');
res.status(400).send('only accepts GET/POST');
}
} else {
return next();
}
};

testApp.configure(function() {
testApp.use('/ng1/lib/angular', express.static(angularDir));
testApp.use(express.static(testAppDir));
testApp.use(express.json());
testApp.use(testMiddleware);
});

main();

0 comments on commit 5930d14

Please sign in to comment.