diff --git a/src/worker.js b/src/worker.js index 14f4c77..18dc9f6 100644 --- a/src/worker.js +++ b/src/worker.js @@ -523,7 +523,17 @@ export default { const key = `sites/${customer}${filePath}`; try { - const object = await env.BUCKET.get(key); + let object = await env.BUCKET.get(key); + + // Fallback: /path.html β†’ /path/index.html (Astro λ“± SSG ν˜Έν™˜) + if (!object && filePath.endsWith('.html') && filePath !== '/index.html') { + const dirPath = filePath.replace(/\.html$/, '/index.html'); + const dirKey = `sites/${customer}${dirPath}`; + object = await env.BUCKET.get(dirKey); + if (object) { + filePath = dirPath; + } + } if (!object) { if (filePath === '/index.html') {