Home / Function/ GET() — astro Function Reference

GET() — astro Function Reference

Architecture documentation for the GET() function in placeholder.png.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  f7f991b1_7e76_2e2d_8282_9d6722c31d5d["GET()"]
  525cffe2_df41_1948_cd7c_959695780304["placeholder.png.ts"]
  f7f991b1_7e76_2e2d_8282_9d6722c31d5d -->|defined in| 525cffe2_df41_1948_cd7c_959695780304
  style f7f991b1_7e76_2e2d_8282_9d6722c31d5d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/test/fixtures/non-html-pages/src/pages/placeholder.png.ts lines 5–15

export const GET: APIRoute = async function get(ctx) {
	try {
		// Image is in the public domain. Sourced from
		// https://en.wikipedia.org/wiki/File:Portrait_placeholder.png
		const buffer = await fs.readFile('./test/fixtures/non-html-pages/src/images/placeholder.png');
		// NOTE: SSG only so not Content-Type needed
		return new Response(buffer.buffer);
	} catch (error: unknown) {
		throw new Error(`Something went wrong in placeholder.png route!: ${error as string}`);
	}
};

Subdomains

Frequently Asked Questions

What does GET() do?
GET() is a function in the astro codebase, defined in packages/astro/test/fixtures/non-html-pages/src/pages/placeholder.png.ts.
Where is GET() defined?
GET() is defined in packages/astro/test/fixtures/non-html-pages/src/pages/placeholder.png.ts at line 5.

Analyze Your Own Codebase

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

Try Supermodel Free