修复 wrangler.toml 内的错误

This commit is contained in:
2025-11-23 17:40:33 +08:00
parent 902faa8f2a
commit e293aea876
3 changed files with 17 additions and 1 deletions
+1
View File
@@ -17,6 +17,7 @@
"wrangler": "^3.35.0" "wrangler": "^3.35.0"
}, },
"dependencies": { "dependencies": {
"@cloudflare/kv-asset-handler": "^0.2.0",
"hexo": "^7.0.0", "hexo": "^7.0.0",
"hexo-deployer-git": "^4.0.0", "hexo-deployer-git": "^4.0.0",
"hexo-generator-archive": "^2.0.0", "hexo-generator-archive": "^2.0.0",
+15
View File
@@ -0,0 +1,15 @@
import { getAssetFromKV } from '@cloudflare/kv-asset-handler';
addEventListener('fetch', event => {
event.respondWith(handleEvent(event));
});
async function handleEvent(event) {
try {
// Let kv-asset-handler serve files from the generated `public/` asset manifest.
return await getAssetFromKV(event);
} catch (e) {
// Fallback: return a simple 404 for missing assets
return new Response('Not Found', { status: 404 });
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
name = "kivotosrailway-website" name = "kivotosrailway-website"
compatibility_date = "2025-11-23" compatibility_date = "2025-11-23"
main = "workers-site/index.js"
[site] [site]
bucket = "./public" bucket = "./public"
entry-point = "workers-site"