Rule based koa static file server middleware
const static = require('reed-koa-static')
const app = new Koa()
//rule could comes form config file
const rule = {
urlPrefix: 'foo',
dirPath: 'static',
// indexPages: ['index.html', 'index.htm']
}
app.use(static(rule))
return app.listen(8000)
urlPrefix: [Optional] Set the URL path prefix
dirPath: [Required] Dir path to the static files
indexPages: [Optional] Set the index page array, default value is ['index.html', 'index.htm']