express-promise-router
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -64,3 +64,3 @@ var Router = require('express').Router; | ||
var args = _.map(arguments, function (arg, idx) { | ||
if (idx === 0 && 'string' === typeof arg) { | ||
if (idx === 0 && 'string' === typeof arg || arg instanceof RegExp) { | ||
return arg; | ||
@@ -67,0 +67,0 @@ } |
{ | ||
"name": "express-promise-router", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"main": "lib/express-promise-router.js", | ||
@@ -5,0 +5,0 @@ "description": "A lightweight wrapper for Express 4's Router that allows middleware to return promises", |
@@ -1,2 +0,2 @@ | ||
# express-controller [![Build Status](https://secure.travis-ci.org/alex-whitney/express-controller.png?branch=master)](http://travis-ci.org/alex-whitney/express-controller) | ||
# express-promise-router | ||
@@ -6,7 +6,9 @@ The best module ever. | ||
## Getting Started | ||
Install the module with: `npm install express-controller` | ||
Install the module with: `npm install express-promise-router` | ||
```javascript | ||
var express-controller = require('express-controller'); | ||
express-controller.awesome(); // "awesome" | ||
var PromiseRouter = require('express-promise-router'); | ||
/* Coming eventually */ | ||
``` | ||
@@ -13,0 +15,0 @@ |
@@ -207,2 +207,15 @@ 'use strict'; | ||
it('should bind to RegExp routes', function (done) { | ||
var fn1 = function (req, res) { | ||
res.send(); | ||
}; | ||
router.get(/^\/foo/, fn1); | ||
bootstrap(router).then(function () { | ||
return GET('/foo'); | ||
}).then(done, done); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11338
286
29