Skip to content

Commit adb392e

Browse files
committed
fix formatting
1 parent 5904429 commit adb392e

File tree

1 file changed

+40
-40
lines changed
  • src/content/docs/workers/development-testing

1 file changed

+40
-40
lines changed

src/content/docs/workers/development-testing/index.mdx

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ During local development, your Worker code interacts with these bindings using t
8484
{
8585
"bucket_name": "screenshots-bucket",
8686
"binding": "screenshots_bucket",
87-
"remote": true
88-
}
89-
]
87+
"remote": true,
88+
},
89+
],
9090
}
9191
```
9292

@@ -118,9 +118,9 @@ If preview configuration is present for a binding, setting `remote: true` will e
118118
"bucket_name": "screenshots-bucket",
119119
"binding": "screenshots_bucket",
120120
"preview_bucket_name": "preview-screenshots-bucket",
121-
"remote": true
122-
}
123-
]
121+
"remote": true,
122+
},
123+
],
124124
}
125125
```
126126

@@ -354,54 +354,56 @@ The function:
354354
Here's a basic example of using Miniflare with `maybeStartOrUpdateRemoteProxySession` to provide a local dev session with remote bindings. This example uses a single hardcoded KV binding.
355355

356356
<TypeScriptExample>
357+
357358
```ts
358359
import { Miniflare, MiniflareOptions } from "miniflare";
359360
import { maybeStartOrUpdateRemoteProxySession } from "wrangler";
360361

361362
let mf: Miniflare | null;
362363

363-
let remoteProxySessionDetails: Awaited<ReturnType<typeof maybeStartOrUpdateRemoteProxySession>> | null = null;
364+
let remoteProxySessionDetails: Awaited<
365+
ReturnType<typeof maybeStartOrUpdateRemoteProxySession>
366+
> | null = null;
364367

365368
async function startOrUpdateDevSession() {
366-
remoteProxySessionDetails = await maybeStartOrUpdateRemoteProxySession({
367-
bindings: {
368-
MY_KV: {
369-
type: 'kv_namespace',
370-
id: 'kv-id',
371-
remote: true,
372-
}
373-
}
374-
},
375-
remoteProxySessionDetails
376-
);
377-
378-
const miniflareOptions: MiniflareOptions = {
379-
scriptPath: "./worker.js",
380-
kvNamespaces: {
381-
MY_KV: {
382-
id: "kv-id",
383-
remoteProxyConnectionString:
384-
remoteProxySessionDetails?.session.remoteProxyConnectionString,
385-
},
386-
},
387-
};
388-
389-
if (!mf) {
390-
mf = new Miniflare(miniflareOptions);
391-
} else {
392-
mf.setOptions(miniflareOptions);
393-
}
394-
369+
remoteProxySessionDetails = await maybeStartOrUpdateRemoteProxySession(
370+
{
371+
bindings: {
372+
MY_KV: {
373+
type: "kv_namespace",
374+
id: "kv-id",
375+
remote: true,
376+
},
377+
},
378+
},
379+
remoteProxySessionDetails,
380+
);
381+
382+
const miniflareOptions: MiniflareOptions = {
383+
scriptPath: "./worker.js",
384+
kvNamespaces: {
385+
MY_KV: {
386+
id: "kv-id",
387+
remoteProxyConnectionString:
388+
remoteProxySessionDetails?.session.remoteProxyConnectionString,
389+
},
390+
},
391+
};
392+
393+
if (!mf) {
394+
mf = new Miniflare(miniflareOptions);
395+
} else {
396+
mf.setOptions(miniflareOptions);
397+
}
395398
}
396399

397400
// ... tool logic that invokes `startOrUpdateDevSession()` ...
398401

399402
// ... once the dev session is no longer needed run
400403
// `remoteProxySessionDetails?.session.dispose()`
401-
402404
```
403-
</TypeScriptExample>
404405

406+
</TypeScriptExample>
405407

406408
## `wrangler dev --remote` (Legacy)
407409

@@ -425,5 +427,3 @@ When using remote development, all bindings automatically connect to their remot
425427
### Limitations
426428

427429
- When you run a remote development session using the `--remote` flag, a limit of 50 [routes](/workers/configuration/routing/routes/) per zone is enforced. Learn more in[ Workers platform limits](/workers/platform/limits/#number-of-routes-per-zone-when-using-wrangler-dev---remote).
428-
429-
```

0 commit comments

Comments
 (0)