@embeddables/cli 0.14.4-beta.3 → 0.15.0

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.
@@ -1,40 +0,0 @@
1
- /**
2
- * Embeddables Workbench - Cloudflare Worker
3
- *
4
- * Serves workbench assets with CORS headers.
5
- * Assets are served from the /public directory.
6
- */
7
-
8
- export default {
9
- async fetch(request, env) {
10
- // Handle CORS preflight
11
- if (request.method === 'OPTIONS') {
12
- return new Response(null, {
13
- headers: corsHeaders(),
14
- });
15
- }
16
-
17
- // Serve static assets from /public
18
- const response = await env.ASSETS.fetch(request);
19
-
20
- // Add CORS headers
21
- const newHeaders = new Headers(response.headers);
22
- Object.entries(corsHeaders()).forEach(([key, value]) => {
23
- newHeaders.set(key, value);
24
- });
25
-
26
- return new Response(response.body, {
27
- status: response.status,
28
- headers: newHeaders,
29
- });
30
- },
31
- };
32
-
33
- function corsHeaders() {
34
- return {
35
- 'Access-Control-Allow-Origin': '*',
36
- 'Access-Control-Allow-Methods': 'GET, OPTIONS',
37
- 'Access-Control-Allow-Headers': 'Content-Type',
38
- 'Access-Control-Max-Age': '86400',
39
- };
40
- }
@@ -1,10 +0,0 @@
1
- # Embeddables Workbench - Cloudflare Worker
2
- #
3
- # Deploy: npx wrangler deploy
4
-
5
- name = "embeddables-workbench"
6
- main = "worker.js"
7
- compatibility_date = "2024-01-01"
8
-
9
- [assets]
10
- directory = "./public"