Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Upgrade express to 1.0.0rc3; add .npmignore.

  • Loading branch information...
commit 299322feccbe131b0bdc18f74be917c75c8d9d6d 1 parent bf05bc6
@reid reid authored
Showing with 22 additions and 20 deletions.
  1. +5 −0 .npmignore
  2. +13 −16 lib/server.js
  3. +4 −4 package.json
View
5 .npmignore
@@ -0,0 +1,5 @@
+test/vendor
+scripts/darwin/build_tmp
+scripts/darwin/build_tmp.dmg
+scripts/darwin/Yeti.dmg
+scripts/darwin/npm-cache
View
29 lib/server.js
@@ -16,14 +16,11 @@ var emitterRegistry = {}; // by port
var cachebuster = makeId();
-function jsonize (params, keys) {
+function jsonize (req, keys) {
var o = {};
- Object.keys(
- params
- ).filter(function (k) {
- return -1 !== keys.indexOf(k)
- }).forEach(function (k) {
- o[k] = params[k];
+ keys.forEach(function (k) {
+ var v = req.param(k);
+ if (v) o[k] = v;
});
return JSON.stringify(o);
}
@@ -42,7 +39,7 @@ function serveExpress (port, path, cb) {
app.get("/", function (req, res) {
tests.emit("visitor", req.ua);
- var json = jsonize(req.params.get, ["transport"])
+ var json = jsonize(req, ["transport"])
res.render("index", {
locals : {
bootstrap : "YETI.start(" + json + ")"
@@ -122,8 +119,8 @@ function serveExpress (port, path, cb) {
});
});
- app.get("/status/:id", function (req, res, params) {
- var id = params.id;
+ app.get("/status/:id", function (req, res) {
+ var id = req.params.id;
if (id in testIds) {
if (id in testResults) {
var results = testResults[id].shift();
@@ -179,10 +176,10 @@ function serveExpress (port, path, cb) {
);
};
- app.get('/project/*', function (req, res, params) {
+ app.get('/project/*', function (req, res) {
var nocache = false;
- var splat = params.splat.pop().split("/");
+ var splat = req.params.pop().split("/");
if (splat[0] in testIds) {
splat.shift();
nocache = true; // using a unique url
@@ -231,12 +228,12 @@ function serveExpress (port, path, cb) {
);
};
- app.get("/inc/*", function (req, res, params) {
- incSend(res, params.splat);
+ app.get("/inc/*", function (req, res) {
+ incSend(res, req.params);
});
- app.get("/dyn/:cachebuster/*", function (req, res, params) {
- incSend(res, params.splat, true);
+ app.get("/dyn/:cachebuster/*", function (req, res) {
+ incSend(res, req.params, true);
});
app.get("/favicon.ico", function (req, res) {
View
8 package.json
@@ -1,6 +1,6 @@
{ "name" : "yeti"
, "description" : "The YUI Easy Testing Interface"
-, "version" : "0.1.0"
+, "version" : "0.1.1pre"
, "author" : "Reid Burke <me@reidburke.com>"
, "homepage" : "http://yuilibrary.com/projects/yeti/"
, "bugs" :
@@ -15,9 +15,9 @@
, "bin" : { "yeti" : "./cli.js" }
, "engines" : { "node" : ">=0.1.101" }
, "dependencies" :
- { "express" : "=1.0.0beta"
- , "connect" : "=0.2.1"
- , "jade" : "=0.2.2"
+ { "express" : "=1.0.0rc3"
+ , "connect" : "=0.2.5"
+ , "jade" : "=0.5.0"
}
, "licenses" :
[ { "type" : "BSD"
Please sign in to comment.
Something went wrong with that request. Please try again.