路径:server/app.js
const path = require('path'); const serve = require('koa-static'); const main = serve(path.join(__dirname)); app.use(main); //读取静态资源
nodejs中安装包
npm i koa-static -s