Files
hiring-test-one/example/custom/cache-control/server.js
Lloyd Brookes 22612bbcf4 docs
2016-06-20 20:32:32 +01:00

19 lines
435 B
JavaScript

'use strict'
const LocalWebServer = require('../../')
const cacheControl = require('koa-cache-control')
const ws = new LocalWebServer()
ws.addLogging('dev')
.add({
optionDefinitions: {
name: 'maxage', type: Number,
description: 'The maxage to set on each response.'
},
middleware: function (options) {
return cacheControl({ maxAge: options.maxage })
}
})
.addStatic()
.addIndex()
.listen()