File tree Expand file tree Collapse file tree 2 files changed +7
-13
lines changed
Expand file tree Collapse file tree 2 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -51,17 +51,18 @@ export class FixtureTestContainer extends DurableObject<Env> {
5151}
5252
5353export default {
54- async fetch ( request , env ) : Promise < Response > {
54+ async fetch ( request , env , ctx : ExecutionContext ) : Promise < Response > {
5555 const url = new URL ( request . url ) ;
5656 if ( url . pathname === "/second" ) {
5757 // This is a second Durable Object that can be used to test multiple DOs
58- const id = env . CONTAINER . idFromName ( "second-container" ) ;
59- const stub = env . CONTAINER . get ( id ) ;
58+ const id =
59+ ctx . exports . FixtureTestContainer . idFromName ( "second-container" ) ;
60+ const stub = ctx . exports . FixtureTestContainer . get ( id ) ;
6061 const query = url . searchParams . get ( "req" ) ;
6162 return stub . fetch ( "http://example.com/" + query ) ;
6263 }
63- const id = env . CONTAINER . idFromName ( "container" ) ;
64- const stub = env . CONTAINER . get ( id ) ;
64+ const id = ctx . exports . FixtureTestContainer . idFromName ( "container" ) ;
65+ const stub = ctx . exports . FixtureTestContainer . get ( id ) ;
6566 return stub . fetch ( request ) ;
6667 } ,
6768} satisfies ExportedHandler < Env > ;
Original file line number Diff line number Diff line change 22 "name" : " container-app" ,
33 "main" : " src/index.ts" ,
44 "compatibility_date" : " 2025-04-03" ,
5+ "compatibility_flags" : [" enable_ctx_exports" ],
56 "containers" : [
67 {
78 "image" : " ./Dockerfile" ,
1011 "max_instances" : 2 ,
1112 },
1213 ],
13- "durable_objects" : {
14- "bindings" : [
15- {
16- "class_name" : " FixtureTestContainer" ,
17- "name" : " CONTAINER" ,
18- },
19- ],
20- },
2114 "migrations" : [
2215 {
2316 "tag" : " v1" ,
You can’t perform that action at this time.
0 commit comments