mirror of
https://github.com/woodchen-ink/Random-Api.git
synced 2025-07-18 14:02:03 +08:00
改为使用pagesdev的静态文件,感觉会方便控制版本,并加快访问速度
This commit is contained in:
parent
9e6970b695
commit
00c04b57d3
@ -1,5 +1,5 @@
|
||||
// 外部 JSON 文件的 URL
|
||||
const CSV_PATHS_URL = 'https://raw.githubusercontent.com/woodchen-ink/Random-Api/main/url.json';
|
||||
const CSV_PATHS_URL = 'https://random-api.pages.dev/url.json';
|
||||
|
||||
addEventListener('fetch', event => {
|
||||
event.respondWith(handleRequest(event.request));
|
||||
@ -43,7 +43,7 @@ async function handleRequest(request) {
|
||||
}
|
||||
} else {
|
||||
// 如果不是 CSV 资源路径,返回 index.html 内容
|
||||
const indexHtmlResponse = await fetch('https://raw.githubusercontent.com/woodchen-ink/Random-Api/main/index.html');
|
||||
const indexHtmlResponse = await fetch('https://random-api.pages.dev');
|
||||
return new Response(indexHtmlResponse.body, {
|
||||
headers: { 'Content-Type': 'text/html' },
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user