diff --git a/eo.js b/eo.js index 02169b9..3fb4415 100644 --- a/eo.js +++ b/eo.js @@ -1,5 +1,5 @@ // 外部 JSON 文件的 URL -const CSV_PATHS_URL = 'https://random-api.pages.dev/url.json'; +const CSV_PATHS_URL = 'https://random-api-file.czl.net/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://random-api.pages.dev'); + const indexHtmlResponse = await fetch('https://random-api-file.czl.net'); return new Response(indexHtmlResponse.body, { headers: { 'Content-Type': 'text/html' }, }); diff --git a/index.html b/index.html index d023977..cbb34a1 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - 随机文件api-wood + 随机文件api @@ -88,9 +88,9 @@ object-fit: cover; } - - - + + + @@ -110,7 +110,7 @@ }); // 异步加载 index.md 文件内容 - fetch('https://random-api.pages.dev/index.md') + fetch('https://random-api-file.czl.net/index.md') .then(response => response.text()) .then(markdownText => { // 渲染 Markdown 内容 @@ -120,4 +120,4 @@ - + \ No newline at end of file diff --git a/nodejs/app.js b/nodejs/app.js index b6c035d..e50f981 100644 --- a/nodejs/app.js +++ b/nodejs/app.js @@ -4,7 +4,7 @@ const app = express(); const port = 5003; // 外部 JSON 文件的 URL -const CSV_PATHS_URL = 'https://random-api.pages.dev/url.json'; +const CSV_PATHS_URL = 'https://random-api-file.czl.net/url.json'; /** * 处理客户端请求,并根据请求的URL路径获取对应的CSV文件中的随机一行的URL,然后重定向到该URL。 @@ -51,7 +51,7 @@ async function handleRequest(req, res) { } } else { // 请求路径不在配置中,返回默认首页 - const indexHtmlResponse = await fetch('https://random-api.pages.dev'); + const indexHtmlResponse = await fetch('https://random-api-file.czl.net'); const indexHtml = await indexHtmlResponse.text(); return res.type('html').send(indexHtml); }