Skip to content

Commit 149210d

Browse files
committed
esm-worker: improve cors
1 parent ec8b200 commit 149210d

File tree

4 files changed

+285
-281
lines changed

4 files changed

+285
-281
lines changed

packages/esm-worker/README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,16 @@ npm install esm-worker@0.135
1717
You need to add following configuration to your `wrangler.toml`:
1818

1919
```toml
20-
kv_namespaces = [
21-
{
22-
binding = "KV",
23-
id = "YOUR_KV_ID",
24-
preview_id = "YOUR_PREVIEW_KV_ID"
25-
}
26-
# your other namespaces...
27-
]
28-
2920
[vars]
30-
ESM_ORIGIN = "https://esm.sh" # change to your self-hosting esm.sh server if needed
21+
ESM_SERVER_ORIGIN = "https://esm.sh/" # change to your self-hosting esm.sh server
3122
NPM_REGISTRY = "https://registry.npmjs.org/" # change to your private npm registry if needed
3223
# your other vars...
3324

25+
[[kv_namespaces]]
26+
binding = "KV"
27+
id = "YOUR_KV_ID"
28+
preview_id = "YOUR_PREVIEW_KV_ID"
29+
3430
[[r2_buckets]]
3531
binding = "R2"
3632
bucket_name = "YOUR_BUCKET_NAME"
@@ -41,7 +37,7 @@ Other optional configurations in secrets:
4137

4238
- If you are using a self-hosting esm.sh server with `authSecret` option, you need to add the following configuration:
4339
```bash
44-
wrangler secret put ESM_TOKEN
40+
wrangler secret put ESM_SERVER_TOKEN
4541
```
4642
- If you are using a private npm registry, you need to add the following configuration:
4743
```bash
@@ -81,7 +77,7 @@ export default withESMWorker((req, env, ctx) => {
8177
);
8278
}
8379

84-
// return void to let esm-worker handle the rest requests
80+
// esm-worker handles the rest
8581
});
8682
```
8783

0 commit comments

Comments
 (0)