Dev mode setting #4

Merged
merged 2 commits into from Sep 9, 2012

Conversation

Projects
None yet
2 participants
@kevinkuebler
Contributor

kevinkuebler commented Aug 10, 2012

This change coerces the model config value to 'debug' when 'development' is passed in. This is to allow the user to do this in their app.js:

var cassette = require('cassette-express')({mode: app.settings.env});

Since express sets the env setting to 'development' by default, this allows us to automatically get the correct behavior from cassette-express regardless of which env we're in, without changing any code.

An alternative to this change, would be to reverse the if check in the useAsset function in cassette.js and explicitly check for 'production', assuming any other value to mean debug.

Aaaaaannnd ... I screwed up the diff again. This time on cassette.js. The line I changed was line #39. Sorry about that - I'll get it right eventually. :-)

kevinkuebler added some commits Aug 9, 2012

Fix src output on Windows systems
On Windows systems, the <script> tags were being output with \'s in the
src attribute instead of /'s.
Allow app env to be passed in for mode config.
Cassette defaults the mode to 'debug' so if anything other than 'debug'
is passed in for the mode config value, it will use the production mode.
Since express uses 'development' as it's env by default, this will
convert 'development' to 'debug' when saving the mode config value.

CharlotteGore added a commit that referenced this pull request Sep 9, 2012

@CharlotteGore CharlotteGore merged commit 038a803 into CharlotteGore:master Sep 9, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment