| 1 | import type { UrlAsyncWorkerEnv } from "./url-stack.ts"; |
| 2 | |
| 3 | /** |
| 4 | * Async (non-Effect) Worker fixture for the `Worker.URL` binding declared via |
| 5 | * `env: { PUBLIC_URL: Cloudflare.Worker.URL }`. `InferEnv` maps the tag to |
| 6 | * `string`, so the handler reads `env.PUBLIC_URL` directly. |
| 7 | */ |
| 8 | export default { |
| 9 | async fetch(_request: Request, env: UrlAsyncWorkerEnv): Promise<Response> { |
| 10 | return Response.json({ url: env.PUBLIC_URL }); |
| 11 | }, |
| 12 | }; |