Home / Function/ GET() — astro Function Reference

GET() — astro Function Reference

Architecture documentation for the GET() function in [id].json.js from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  7d97be56_ff99_3f6a_64c1_f1b9670e0ceb["GET()"]
  7283df45_32da_d4df_befb_9095b4af680e["[id].json.js"]
  7d97be56_ff99_3f6a_64c1_f1b9670e0ceb -->|defined in| 7283df45_32da_d4df_befb_9095b4af680e
  style 7d97be56_ff99_3f6a_64c1_f1b9670e0ceb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/test/fixtures/data-collections-schema/src/pages/authors/[id].json.js lines 10–18

export async function GET({ params }) {
	const { id } = params;
	const author = await getEntry('authors', id);
	if (!author) {
		return Response.json({ error: `Author ${id} Not found` });
	} else {
		return Response.json(author);
	}
}

Subdomains

Frequently Asked Questions

What does GET() do?
GET() is a function in the astro codebase, defined in packages/astro/test/fixtures/data-collections-schema/src/pages/authors/[id].json.js.
Where is GET() defined?
GET() is defined in packages/astro/test/fixtures/data-collections-schema/src/pages/authors/[id].json.js at line 10.

Analyze Your Own Codebase

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

Try Supermodel Free