From fc4c9c8a430b0b09175db7d2567bf6ebb862ef11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ask=20Bj=C3=B8rn=20Hansen?= Date: Wed, 22 Feb 2012 01:48:52 -0800 Subject: [PATCH] Update example of how to add a custom strategy --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2bb9cf5..5111e8b 100644 --- a/README.md +++ b/README.md @@ -272,6 +272,8 @@ Its pretty simple to register a custom strategy. There are 3 things the object Example: +always.js: + var AlwaysPass = function (config) { this.config }; AlwaysPass.prototype.check = function (callback) { callback(true); @@ -281,5 +283,8 @@ Example: // no op }; - require('./upbeat').registerCallback('always-pass', AlwaysPass); + module.exports = AlwaysPass; + +And then add to bin/upbeat, though the path is relative to lib/upbeat/ + upbeat.registerStrategy('always-pass', '../../always.js');