[lang].json.js — astro Source File
Architecture documentation for [lang].json.js, a javascript file in the astro codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 61c27158_30e5_935d_6492_da707707d9fe["[lang].json.js"] 48f80d01_e646_3924_78f6_a9d836644746["astro:content"] 61c27158_30e5_935d_6492_da707707d9fe --> 48f80d01_e646_3924_78f6_a9d836644746 style 61c27158_30e5_935d_6492_da707707d9fe fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { getEntry } from 'astro:content';
const langs = ['en', 'es', 'fr'];
export function getStaticPaths() {
return langs.map((lang) => ({ params: { lang } }));
}
/** @param {import('astro').APIContext} params */
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);
}
}
Domain
Subdomains
Functions
Dependencies
- astro:content
Source
Frequently Asked Questions
What does [lang].json.js do?
[lang].json.js is a source file in the astro codebase, written in javascript. It belongs to the IntegrationAdapters domain, SsrAdapters subdomain.
What functions are defined in [lang].json.js?
[lang].json.js defines 2 function(s): GET, getStaticPaths.
What does [lang].json.js depend on?
[lang].json.js imports 1 module(s): astro:content.
Where is [lang].json.js in the architecture?
[lang].json.js is located at packages/astro/test/fixtures/data-collections/src/pages/translations/[lang].json.js (domain: IntegrationAdapters, subdomain: SsrAdapters, directory: packages/astro/test/fixtures/data-collections/src/pages/translations).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free