koa静态服务器
emer 发布于 2018-7-19 10:52 2276 次阅读
const Koa = require('koa') const app = new Koa() const serve = require("koa-static"); const port=3001; app.use(serve(__dirname+"/public",{ extensions: ['html']})); app.listen(port); console.log("服务端口"+port);
public 目录下作为静态资源根目录