Home / Function/ GET() — astro Function Reference

GET() — astro Function Reference

Architecture documentation for the GET() function in api.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  42d80f3b_ef10_5d7b_367f_e2d54ffae4d0["GET()"]
  68ca2352_7cdb_3503_ddbf_40442b031ab0["api.ts"]
  42d80f3b_ef10_5d7b_367f_e2d54ffae4d0 -->|defined in| 68ca2352_7cdb_3503_ddbf_40442b031ab0
  style 42d80f3b_ef10_5d7b_367f_e2d54ffae4d0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/node/test/fixtures/sessions/src/pages/api.ts lines 3–13

export const GET: APIRoute = async (context) => {
	const url = new URL(context.url, 'http://localhost');
	let value = url.searchParams.get('set');
	if (value) {
		 context.session.set('value', value);
	} else {
		value = await context.session.get('value');
	}
	const cart = await context.session.get('cart');
	return Response.json({ value, cart });
};

Domain

Subdomains

Frequently Asked Questions

What does GET() do?
GET() is a function in the astro codebase, defined in packages/integrations/node/test/fixtures/sessions/src/pages/api.ts.
Where is GET() defined?
GET() is defined in packages/integrations/node/test/fixtures/sessions/src/pages/api.ts at line 3.

Analyze Your Own Codebase

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

Try Supermodel Free