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.
 
 
 

17 lines
439 B

'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.middleware.maxage })
}
})
.addStatic()
.addIndex()
.start()