Skip to content

Commit

Permalink
[Add] 🎉 Cloudflare Page Deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-zklcdc committed Apr 1, 2024
1 parent ca8f19a commit 10f39d9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cloudflare/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

cp -r web cloudflare/web

rm cloudflare/web/web.go
rm -rf go-proxy-bingai

rm -rf !(cloudflare)
mv cloudflare/* .

sed -i "s/if (currentUrl.pathname === '\/' || currentUrl.pathname.indexOf('\/web\/') === 0) {/if (currentUrl.pathname === '\/') {/g" worker.js
sed -i "s/return home(currentUrl.pathname);/let res = new Response('', {\n status: 302,\n });\n res.headers.set('location', '\/web\/');\n return res;\n }\n if (currentUrl.pathname.indexOf('\/web\/') === 0) {\n return env.ASSETS.fetch(request);/g" worker.js

mv worker.js _worker.js

0 comments on commit 10f39d9

Please sign in to comment.