GET() — astro Function Reference
Architecture documentation for the GET() function in collections.json.js from the astro codebase.
Entity Profile
Dependency Diagram
graph TD bbf91b57_0cc6_4501_f006_9abc5b3a56a1["GET()"] 10a95760_a970_87df_5da9_6d89809adea5["collections.json.js"] bbf91b57_0cc6_4501_f006_9abc5b3a56a1 -->|defined in| 10a95760_a970_87df_5da9_6d89809adea5 style bbf91b57_0cc6_4501_f006_9abc5b3a56a1 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/test/fixtures/content-layer/src/pages/collections.json.js lines 4–86
export async function GET() {
const customLoader = await getCollection('blog', (entry) => {
return entry.data.id < 6;
});
const jsonLoader = await getCollection('dogs');
const dataEntry = await getEntry('dogs', 'beagle');
const simpleLoader = await getCollection('cats');
const entryWithReference = await getEntry('spacecraft', 'columbia-copy');
const atlantis = await getEntry('spacecraft', 'atlantis');
const referencedEntry = await getEntry(entryWithReference.data.cat);
const spacecraft = await getCollection('spacecraft');
const spacecraftNoBody = await getCollection('spacecraftNoBody');
const entryWithImagePath = await getEntry('spacecraft', 'lunar-module');
const increment = await getEntry('increment', 'value');
const images = await getCollection('images');
const simpleLoaderObject = await getCollection('rodents')
const probes = await getCollection('probes');
const yamlLoader = await getCollection('fish');
const tomlLoader = await getCollection('songs');
const nestedJsonLoader = await getCollection('birds');
const loaderWithAsyncParse = await getCollection('birdsWithAsyncParse');
const csvLoader = await getCollection('plants');
const rockets = await getCollection('rockets');
const numbers = await getCollection('numbers');
const numbersYaml = await getCollection('numbersYaml');
const numbersToml = await getCollection('numbersToml');
const renderMarkdownTest = await getEntry('renderMarkdownTest', 'with-frontmatter');
const renderMarkdownWithImage = await getEntry('renderMarkdownTest', 'with-image');
// Test for #12689 - dynamic import in loader
const dynamicImportLoader = await getCollection('dynamicImport');
return new Response(
devalue.stringify({
customLoader,
jsonLoader,
dataEntry,
simpleLoader,
simpleLoaderObject,
entryWithReference,
entryWithImagePath,
referencedEntry,
increment,
numbers,
numbersYaml,
numbersToml,
images,
rockets,
probes,
yamlLoader,
tomlLoader,
nestedJsonLoader,
loaderWithAsyncParse,
csvLoader,
atlantis,
spacecraft: spacecraft.map(({id}) => id).sort((a, b) => a.localeCompare(b)),
spacecraftWithBody: spacecraft.map(({id, body}) => ({id, body})),
spacecraftNoBody: spacecraftNoBody.map(({id, body}) => ({id, body})),
renderMarkdownTest,
renderMarkdownWithImage,
dynamicImportLoader,
})
Domain
Subdomains
Source
Frequently Asked Questions
What does GET() do?
GET() is a function in the astro codebase, defined in packages/astro/test/fixtures/content-layer/src/pages/collections.json.js.
Where is GET() defined?
GET() is defined in packages/astro/test/fixtures/content-layer/src/pages/collections.json.js at line 4.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free