Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
hooray committed Jun 3, 2024
1 parent 0e7bd1f commit c5dae61
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions public/functions/_worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default {
async fetch(request, env) {
const url = new URL(request.url)

// 重定向到子站点
if (url.pathname.startsWith('/pro-example')) {
url.hostname = 'fantastic-mobile-pro-example.pages.dev'
return fetch(url.toString(), request)
}

// 其他路径处理
return env.ASSETS.fetch(request)
},
}

0 comments on commit c5dae61

Please sign in to comment.