1.0.1 • Published 4 years ago
reed-koa-static v1.0.1
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']