serby / compact

A simple JavaScript compacting middleware for express
50 stars 14 forks source link

Using with Express 3.x #14

Closed SlashmanX closed 12 years ago

SlashmanX commented 12 years ago

Just a quick heads up that anyone wanting to use this on Express 3.x needs to change line 201 in compact.js as app.helpers are not used anymore. You simply have to change it to app.locals

I would create a pull request but it seems trivial for one simple word change

serby commented 12 years ago

Thanks for the heads up. Will that also work in express 2.0?

On 19 June 2012 10:32, Eóin Martin < reply@reply.github.com

wrote:

Just a quick heads up that anyone wanting to use this on Express 3.x needs to change line 201 in compact.js as app.helpers are not used anymore. You simply have to change it to app.locals

I would create a pull request but it seems trivial for one simple word change


Reply to this email directly or view it on GitHub: https://github.com/serby/compact/issues/14

paul.serby@clock.co.uk Chief Technology Officer

_Direct: +44 2030 516115_Mobile: +44 7881 550999 *

*

SlashmanX commented 12 years ago

I don't believe so. As you can see at the Express Wiki , app.locals is a new feature.

bengourley commented 12 years ago

Might need to do a bit of feature detection, or ask app what version of Express it is. We should address this with #10 which will be a big refactor.

serby commented 12 years ago

@bengourley definitely. Feature detection, rather than version detection.

 locals = app.helpers || app.locals;
 if (locals === undefined) {
   // error
 }
serby commented 12 years ago

This should be fixed now