静态资源加载
利用中间件 koa-static
const Koa = require('koa')
const app = new Koa()
const path = require('path')
const static = require('koa-static')
// 静态资源目录对于相对入口文件index.js的路径
const staticPath = './static'
app.use(static(
path.join( __dirname, staticPath)
))
app.use( ctx => {
ctx.body = '404'
})
app.listen(3000)