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
  38a8b4c8_f8fe_ba01_b187_7d4b98562c8c["GET()"]
  f9cb52a2_fcfd_8150_f592_00e4db6d3a00["[lang].json.js"]
  38a8b4c8_f8fe_ba01_b187_7d4b98562c8c -->|defined in| f9cb52a2_fcfd_8150_f592_00e4db6d3a00
  style 38a8b4c8_f8fe_ba01_b187_7d4b98562c8c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

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