reed-koa-static
v1.0.1
Published
rule based koa static file server middleware
Downloads
600
Readme
Reed Koa Static
Rule based koa static file server middleware
Sample
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)
Options
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']