Home / Function/ createAstro() — astro Function Reference

createAstro() — astro Function Reference

Architecture documentation for the createAstro() function in astro-global.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  d686a682_f7ad_2c8c_4731_d6d561bcdb35["createAstro()"]
  79d578d0_f5f2_07a8_25f9_c215243ca5bc["astro-global.ts"]
  d686a682_f7ad_2c8c_4731_d6d561bcdb35 -->|defined in| 79d578d0_f5f2_07a8_25f9_c215243ca5bc
  63a02a57_704f_b633_a733_6a36e7b3a685["createError()"]
  d686a682_f7ad_2c8c_4731_d6d561bcdb35 -->|calls| 63a02a57_704f_b633_a733_6a36e7b3a685
  style d686a682_f7ad_2c8c_4731_d6d561bcdb35 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/runtime/server/astro-global.ts lines 14–99

export function createAstro(site: string | undefined): AstroGlobal {
	return {
		// TODO: throw in Astro 7
		get site() {
			// This is created inside of the runtime so we don't have access to the Astro logger.
			console.warn(
				`Astro.site inside getStaticPaths is deprecated and will be removed in a future major version of Astro. Use import.meta.env.SITE instead`,
			);
			return site ? new URL(site) : undefined;
		},
		// TODO: throw in Astro 7
		get generator() {
			// This is created inside of the runtime so we don't have access to the Astro logger.
			console.warn(
				`Astro.generator inside getStaticPaths is deprecated and will be removed in a future major version of Astro.`,
			);
			return ASTRO_GENERATOR;
		},
		get callAction(): any {
			throw createError('callAction');
		},
		get clientAddress(): any {
			throw createError('clientAddress');
		},
		get cookies(): any {
			throw createError('cookies');
		},
		get csp(): any {
			throw createError('csp');
		},
		get currentLocale(): any {
			throw createError('currentLocale');
		},
		get getActionResult(): any {
			throw createError('getActionResult');
		},
		get isPrerendered(): any {
			throw createError('isPrerendered');
		},
		get locals(): any {
			throw createError('locals');
		},
		get originPathname(): any {
			throw createError('originPathname');
		},
		get params(): any {
			throw createError('params');
		},
		get preferredLocale(): any {
			throw createError('preferredLocale');
		},
		get preferredLocaleList(): any {
			throw createError('preferredLocaleList');
		},
		get props(): any {
			throw createError('props');
		},
		get redirect(): any {
			throw createError('redirect');
		},
		get request(): any {
			throw createError('request');
		},
		get response(): any {
			throw createError('response');
		},
		get rewrite(): any {
			throw createError('rewrite');
		},
		get routePattern(): any {
			throw createError('routePattern');
		},
		get self(): any {
			throw createError('self');
		},
		get slots(): any {
			throw createError('slots');
		},
		get url(): any {
			throw createError('url');
		},

Domain

Subdomains

Frequently Asked Questions

What does createAstro() do?
createAstro() is a function in the astro codebase, defined in packages/astro/src/runtime/server/astro-global.ts.
Where is createAstro() defined?
createAstro() is defined in packages/astro/src/runtime/server/astro-global.ts at line 14.
What does createAstro() call?
createAstro() calls 1 function(s): createError.

Analyze Your Own Codebase

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

Try Supermodel Free