演示代理 前缀 https://github.jobcher.com/gh/
下载仓库 git clone https://github.jobcher.com/gh/<你要下载的GitHub地址>
1#例子 2git clone https://github.jobcher.com/gh/https://github.com/jobcher/blog.git 部署 复制js到cloudflare worker
1'use strict' 2 3/** 4 * static files (404.html, sw.js, conf.js) 5 */ 6const ASSET_URL = 'https://jobcher.github.io/' 7// 前缀,如果自定义路由为example.com/gh/*,将PREFIX改为 '/gh/',注意,少一个杠都会错! 8const PREFIX = '/gh/' 9// 分支文件使用jsDelivr镜像的开关,0为关闭,默认关闭 10const Config = { 11 jsdelivr: 0 12} 13 14const whiteList = [] // 白名单,路径里面有包含字符的才会通过,e.g. ['/username/'] 15 16/** @type {RequestInit} */ 17const PREFLIGHT_INIT = { 18 status: 204, 19 headers: new Headers({ 20 'access-control-allow-origin': '*', 21 'access-control-allow-methods': 'GET,POST,PUT,PATCH,TRACE,DELETE,HEAD,OPTIONS', 22 'access-control-max-age': '1728000', 23 }), 24} 25 26 27const exp1 = /^(?