mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 00:40:56 -05:00
Experimenting with using compress() in production.
This commit is contained in:
parent
c944e78271
commit
df95e8c784
2 changed files with 5 additions and 1 deletions
|
@ -261,7 +261,7 @@ module.exports = class Handler
|
||||||
tv4 = require('tv4').tv4
|
tv4 = require('tv4').tv4
|
||||||
res = tv4.validateMultiple(input, @jsonSchema)
|
res = tv4.validateMultiple(input, @jsonSchema)
|
||||||
res
|
res
|
||||||
|
|
||||||
@isID: (id) -> _.isString(id) and id.length is 24 and id.match(/[a-z0-9]/gi)?.length is 24
|
@isID: (id) -> _.isString(id) and id.length is 24 and id.match(/[a-z0-9]/gi)?.length is 24
|
||||||
|
|
||||||
getDocumentForIdOrSlug: (idOrSlug, done) ->
|
getDocumentForIdOrSlug: (idOrSlug, done) ->
|
||||||
|
|
|
@ -47,6 +47,8 @@ setupExpressMiddleware = (app) ->
|
||||||
app.use(express.bodyParser())
|
app.use(express.bodyParser())
|
||||||
app.use(express.methodOverride())
|
app.use(express.methodOverride())
|
||||||
app.use(express.cookieSession({secret:'defenestrate'}))
|
app.use(express.cookieSession({secret:'defenestrate'}))
|
||||||
|
if config.isProduction
|
||||||
|
app.use(express.compress())
|
||||||
|
|
||||||
setupPassportMiddleware = (app) ->
|
setupPassportMiddleware = (app) ->
|
||||||
app.use(authentication.initialize())
|
app.use(authentication.initialize())
|
||||||
|
@ -115,3 +117,5 @@ exports.setExpressConfigurationOptions = (app) ->
|
||||||
app.set('views', __dirname + '/app/views')
|
app.set('views', __dirname + '/app/views')
|
||||||
app.set('view engine', 'jade')
|
app.set('view engine', 'jade')
|
||||||
app.set('view options', { layout: false })
|
app.set('view options', { layout: false })
|
||||||
|
app.set('env', if config.isProduction then 'production' else 'development')
|
||||||
|
app.set('json spaces', 0)
|
||||||
|
|
Loading…
Reference in a new issue