Skip to content

Commit

Permalink
feat(koa): implement koa-compress
Browse files Browse the repository at this point in the history
  • Loading branch information
kiki-le-singe committed Jan 9, 2017
1 parent fbfdd9f commit cdbefef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/server/koa.prod.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Koa from 'koa'
import compress from 'koa-compress'
import _debug from 'debug'
import serve from 'koa-static'

Expand All @@ -9,6 +10,11 @@ const debug = _debug('app:server:prod')
const app = new Koa()
const { SERVER_HOST, SERVER_PORT } = projectConfig

app.use(compress({
threshold: 2048,
flush: require('zlib').Z_SYNC_FLUSH
}))

app.use(serve('static'))

// This is fired every time the server side receives a request
Expand Down

0 comments on commit cdbefef

Please sign in to comment.