ql-io/cluster2 — pull request #4 by evocateur (2012-06-25 18:04:11+00:00)
Title: Register ejs as .ejs handler to avoid error when monitor path requested

When cluster2 is used as a dependency by another project, accessing the monitor path elicits this error stack:

```
Error: Cannot find module 'ejs'
at Function._resolveFilename (module.js:337:11)
at Function._load (module.js:279:25)
at Module.require (module.js:359:17)
at require (module.js:375:17)
at View.templateEngine (/[...]/node_modules/express/lib/view/view.js:134:38)
at Function.compile (/[...]/node_modules/express/lib/view.js:68:17)
at ServerResponse._render (/[...]/node_modules/express/lib/view.js:417:18)
at ServerResponse.render (/[...]/node_modules/express/lib/view.js:318:17)
at /[...]/node_modules/cluster2/lib/monitor.js:45:17
at callbacks (/[...]/node_modules/cluster2/node_modules/express/lib/router/index.js:272:11)
```

Effectively, without the `app.register` call, node is using the current project's node_modules as it's starting point for evaluating the require path, and not the dependency's nested node_modules. I don't know why, but it's probably due to closures at some point in the stack that are preserving the modified "current working directory".