@alteran/astro 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/worker/runtime.ts +14 -0
package/package.json
CHANGED
package/src/worker/runtime.ts
CHANGED
|
@@ -33,6 +33,20 @@ export function createPdsFetchHandler(options?: CreatePdsFetchHandlerOptions): P
|
|
|
33
33
|
// treat secrets uniformly regardless of source (Secret or Secret Store).
|
|
34
34
|
const resolvedEnv = await resolveEnvSecrets(env);
|
|
35
35
|
|
|
36
|
+
// Cloudflare's Astro adapter expects an ASSETS binding for serving static
|
|
37
|
+
// fallback content. Our worker doesn't ship static assets in production,
|
|
38
|
+
// so provide a no-op stub to prevent adapter crashes (error code 1101).
|
|
39
|
+
if (!resolvedEnv.ASSETS || typeof (resolvedEnv as any).ASSETS.fetch !== 'function') {
|
|
40
|
+
(resolvedEnv as any).ASSETS = {
|
|
41
|
+
async fetch() {
|
|
42
|
+
return new Response('Not Found', {
|
|
43
|
+
status: 404,
|
|
44
|
+
headers: { 'Cache-Control': 'public, max-age=60' },
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
36
50
|
try {
|
|
37
51
|
validateConfigOrThrow(resolvedEnv);
|
|
38
52
|
} catch (error) {
|