koa-static源码简单实现分析
const Koa = require('koa');
const app = new Koa();
// 静态资源
// const staticServer = require('koa-static');
app.use(staticServer('./static'))
app.use(staticServer('./static/img'))
const server = app.listen(8899, (res) => {
console.log('服务已启动...')
})
原创
2022-02-24 19:09:16 ·
246 阅读 ·
0 评论