@astrale-os/adapter-cloudflare 0.5.0-beta.44 → 0.5.0-beta.46
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/dist/worker/entry.js +9 -4
- package/package.json +2 -2
package/dist/worker/entry.js
CHANGED
|
@@ -122,13 +122,18 @@ async function frontendAsset(frontend, environment, url, request) {
|
|
|
122
122
|
frontend.source.spa &&
|
|
123
123
|
(candidate.path === '/' || url.pathname.startsWith(`${candidate.path}/`))))
|
|
124
124
|
.sort((left, right) => right.path.length - left.path.length)[0];
|
|
125
|
-
if (route === undefined && !assetPath)
|
|
126
|
-
return undefined;
|
|
127
125
|
const assets = environment.ASSETS;
|
|
128
126
|
if (assets === undefined)
|
|
129
127
|
return undefined;
|
|
130
|
-
if (route === undefined)
|
|
131
|
-
|
|
128
|
+
if (route === undefined) {
|
|
129
|
+
const response = await assets.fetch(request);
|
|
130
|
+
return assetPath || response.status !== 404 ? response : undefined;
|
|
131
|
+
}
|
|
132
|
+
if (route.path !== url.pathname) {
|
|
133
|
+
const response = await assets.fetch(request);
|
|
134
|
+
if (response.status !== 404)
|
|
135
|
+
return response;
|
|
136
|
+
}
|
|
132
137
|
return assets.fetch(new Request(new URL(`/${route.document}${url.search}`, url.origin), request));
|
|
133
138
|
}
|
|
134
139
|
function reserved(path) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-os/adapter-cloudflare",
|
|
3
|
-
"version": "0.5.0-beta.
|
|
3
|
+
"version": "0.5.0-beta.46",
|
|
4
4
|
"description": "Deploy an Astrale application through Cloudflare Workers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adapter",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"hono": "^4.6.20",
|
|
46
46
|
"jose": "^6.1.3",
|
|
47
47
|
"wrangler": "4.123.0",
|
|
48
|
-
"@astrale-os/sdk": "^0.5.0-beta.
|
|
48
|
+
"@astrale-os/sdk": "^0.5.0-beta.43"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@astrale-os/ox": ">=0.1.0 <1.0.0",
|