serby/versionator — Issue #3: basic middleware example in readme.md up to date?
Author: cri5ti
Created: 2012-03-06 15:19:44+00:00
State: open

First of all, thank you for the ideas and your hard work!

I had an issue trying to use your module, I was following the example code in the readme.md file:

app.use(basic.middleware('v' + app.version))

Will cause an exception:

TypeError: undefined is not a function
at Object.middleware (/Users/cristi/Desktop/websteer/websteer/node/node_modules/versionator/lib/middleware/basic.js:40:16)
at HTTPServer. (/Users/cristi/Desktop/websteer/websteer/node/server.js:54:19)
at HTTPServer.configure (/Users/cristi/Desktop/websteer/websteer/node/node_modules/express/lib/http.js:542:61)
at Object. (/Users/cristi/Desktop/websteer/websteer/node/server.js:41:5)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)

I changed it to `app.use(basic.middleware)` and it seems to work. The version is already specified when requiring the module:

var basic = require('versionator').createBasic("v0.01");

I'm using node `v0.6.11` with express.

Thanks for your time!

Chris