Home / Function/ default.fetch() — astro Function Reference

default.fetch() — astro Function Reference

Architecture documentation for the default.fetch() function in worker.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  05d9fb53_84d2_ba8b_37c3_1366911fe760["default.fetch()"]
  fdeb3778_c429_a272_fbd4_14d8961f08a8["worker.ts"]
  05d9fb53_84d2_ba8b_37c3_1366911fe760 -->|defined in| fdeb3778_c429_a272_fbd4_14d8961f08a8
  style 05d9fb53_84d2_ba8b_37c3_1366911fe760 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/cloudflare/test/fixtures/custom-entryfile/src/worker.ts lines 12–23

	async fetch(request, env, ctx) {
		const response = await handle(request, env, ctx);
		// Clone response to make headers mutable, add custom header to prove custom entrypoint is used
		return new Response(response.body, {
			status: response.status,
			statusText: response.statusText,
			headers: {
				...Object.fromEntries(response.headers.entries()),
				'X-Custom-Entrypoint': 'true',
			},
		});
	},

Domain

Subdomains

Frequently Asked Questions

What does default.fetch() do?
default.fetch() is a function in the astro codebase, defined in packages/integrations/cloudflare/test/fixtures/custom-entryfile/src/worker.ts.
Where is default.fetch() defined?
default.fetch() is defined in packages/integrations/cloudflare/test/fixtures/custom-entryfile/src/worker.ts at line 12.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free