Home / File/ welcome-data.json.js — astro Source File

welcome-data.json.js — astro Source File

Architecture documentation for welcome-data.json.js, a javascript file in the astro codebase. 1 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  62443d6c_9469_343b_d89f_341449b2be77["welcome-data.json.js"]
  48f80d01_e646_3924_78f6_a9d836644746["astro:content"]
  62443d6c_9469_343b_d89f_341449b2be77 --> 48f80d01_e646_3924_78f6_a9d836644746
  style 62443d6c_9469_343b_d89f_341449b2be77 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { getEntries, getEntry } from 'astro:content';

export async function GET() {
	const welcomePost = await getEntry('blog', 'welcome');

	if (!welcomePost?.data) {
		return Response.json({ error: 'blog/welcome did not return `data`.' }, { status: 404 })
	}

	const banner = await getEntry(welcomePost.data.banner);
	const author = await getEntry(welcomePost.data.author);
	const relatedPosts = await getEntries(welcomePost.data.relatedPosts ?? []);

	return Response.json({
		welcomePost,
		banner,
		author,
		relatedPosts,
	})
}

Subdomains

Functions

Dependencies

  • astro:content

Frequently Asked Questions

What does welcome-data.json.js do?
welcome-data.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 welcome-data.json.js?
welcome-data.json.js defines 1 function(s): GET.
What does welcome-data.json.js depend on?
welcome-data.json.js imports 1 module(s): astro:content.
Where is welcome-data.json.js in the architecture?
welcome-data.json.js is located at packages/astro/test/fixtures/content-collection-references/src/pages/welcome-data.json.js (domain: IntegrationAdapters, subdomain: SsrAdapters, directory: packages/astro/test/fixtures/content-collection-references/src/pages).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free