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
  a16f60a3_5cc7_93ae_ad60_2f58a8334b75["GET()"]
  98478838_d69d_25f8_4a51_e14e94cabef4["[id].json.js"]
  a16f60a3_5cc7_93ae_ad60_2f58a8334b75 -->|defined in| 98478838_d69d_25f8_4a51_e14e94cabef4
  style a16f60a3_5cc7_93ae_ad60_2f58a8334b75 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/test/fixtures/data-collections/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/src/pages/authors/[id].json.js.
Where is GET() defined?
GET() is defined in packages/astro/test/fixtures/data-collections/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