问题描述
我刚刚测试了Oak的静态页面,发现它在请求sw.js
:
app.use(async (ctx,next) => {
const req_pathname = ctx.request.url.pathname;
const req_file = public_folder + req_pathname;
console.log(req_file); // <- line in question
// make sure to run without --allow-write flag
await ensureFile(req_file).then(async _ => {
await send(ctx,req_pathname,{ root: public_folder });
}).catch(async _ => {
await next();
});
});
当我请求“ /”时,我得到:
.../public/
.../public/favicon.ico
.../public/sw.js
首先,它要问我要问的问题,然后问favicon.ico
,然后问 sw.js
。这是什么文件最奇怪的部分是它甚至没有出现在Firefox网络工具上:
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)