##使用方法
直接上传 pages 然后部署
##Instructions
Upload pages directly and click deploy
export default { | |
async fetch(request, env) { | |
let url = new URL(request.url); | |
if (url.pathname.startsWith('/')) { | |
url.hostname="huggingface-node.pages.dev"; | |
let new_request=new Request(url,request); | |
return fetch(new_request); | |
} | |
// Otherwise, serve the static assets. | |
return env.ASSETS.fetch(request); | |
} | |
}; |