Home / Function/ GET() — astro Function Reference

GET() — astro Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  fc588278_e6a9_719c_2954_4e4a30dd5c1b["GET()"]
  61c27158_30e5_935d_6492_da707707d9fe["[lang].json.js"]
  fc588278_e6a9_719c_2954_4e4a30dd5c1b -->|defined in| 61c27158_30e5_935d_6492_da707707d9fe
  style fc588278_e6a9_719c_2954_4e4a30dd5c1b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/test/fixtures/data-collections/src/pages/translations/[lang].json.js lines 10–18

export async function GET({ params }) {
	const { lang } = params;
	const translations = await getEntry('i18n', lang);
	if (!translations) {
		return Response.json({ error: `Translation ${lang} Not found` });
	} else {
		return Response.json(translations);
	}
}

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