From aff3ed9c4431f3db8c495d6bf0ef5894326b8dd8 Mon Sep 17 00:00:00 2001 From: Eric Martindale Date: Sun, 29 Jun 2014 18:01:41 -0400 Subject: [PATCH] Expose middleware in library. --- index.js | 2 +- package.json | 6 +++++- test/bitauth.js | 10 ++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 14c9f38..ac8a71e 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,6 @@ var bitauth = require('./lib/bitauth'); // add node-specific encrypt/decrypt bitauth.encrypt = require('./lib/encrypt'); bitauth.decrypt = require('./lib/decrypt'); - +bitauth.middleware = require('./lib/middleware/bitauth'); module.exports = bitauth; diff --git a/package.json b/package.json index 9609408..fd0df9a 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,10 @@ "email": "patrick@bitpay.com" }, "contributors": [ + { + "name": "Eric Martindale", + "email": "eric@ericmartindale.com" + }, { "name": "Gordon Hall", "email": "gordon@bitpay.com" @@ -13,7 +17,7 @@ ], "scripts": { "make-dist": "sh scripts/make-dist.sh", - "test": "node_modules/.bin/mocha test/* --reporter spec", + "test": "mocha test/* --reporter spec", "postinstall": "npm run make-dist" }, "main": "index.js", diff --git a/test/bitauth.js b/test/bitauth.js index e2d2b12..94b7185 100644 --- a/test/bitauth.js +++ b/test/bitauth.js @@ -79,4 +79,14 @@ describe('bitauth', function() { }); + describe('#middleware', function() { + + it('should expose an express middleware', function(done) { + bitauth.middleware( {} , {} , function() { + done(); + }); + }); + + }); + });