Files
hiring-test-one/extend/cache-control.js
2016-06-18 10:13:27 +01:00

18 lines
428 B
JavaScript

'use strict'
const LocalWebServer = require('../')
const cacheControl = require('koa-cache-control')
const optionDefinitions = { name: 'maxage', type: Number, defaultValue: 1000 }
const ws = new LocalWebServer()
ws.addLogging('dev')
.add({
optionDefinitions: optionDefinitions,
middleware: function (options) {
return cacheControl({ maxAge: options.maxage })
}
})
.addStatic()
.addIndex()
.start()