You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
433 B

9 years ago
9 years ago
9 years ago
9 years ago
  1. 'use strict'
  2. const Cli = require('../cli')
  3. const cacheControl = require('koa-cache-control')
  4. const cliData = require('../lib/cli-data')
  5. cliData.push({ name: 'black' })
  6. const ws = new Cli({
  7. 'no-cache': true,
  8. log: { format: 'dev' }
  9. })
  10. ws.middleware.splice(
  11. ws.middleware.findIndex(m => m.name === 'mime-type'),
  12. 1,
  13. {
  14. name: 'cache-control',
  15. create: convert(cacheControl({
  16. maxAge: 15
  17. }))
  18. }
  19. )
  20. ws.listen()