Home / Function/ insertPageRoute() — astro Function Reference

insertPageRoute() — astro Function Reference

Architecture documentation for the insertPageRoute() function in index.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  8f2a3706_249d_68c3_8808_f4aae52abe06["insertPageRoute()"]
  cb9f7e72_0a2c_f337_8c0f_3a16cbafeab3["experimental_AstroContainer"]
  8f2a3706_249d_68c3_8808_f4aae52abe06 -->|defined in| cb9f7e72_0a2c_f337_8c0f_3a16cbafeab3
  style 8f2a3706_249d_68c3_8808_f4aae52abe06 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/container/index.ts lines 563–579

	public insertPageRoute(
		route: string,
		component: AstroComponentFactory,
		params?: Record<string, string | undefined>,
	) {
		const url = new URL(route, 'https://example.com/');
		const routeData: RouteData = this.#createRoute(url, params ?? {}, 'page');
		this.#pipeline.manifest.routes.push({
			routeData,
			file: '',
			links: [],
			styles: [],
			scripts: [],
		});
		const componentInstance = this.#wrapComponent(component, params);
		this.#pipeline.insertRoute(routeData, componentInstance);
	}

Domain

Subdomains

Frequently Asked Questions

What does insertPageRoute() do?
insertPageRoute() is a function in the astro codebase, defined in packages/astro/src/container/index.ts.
Where is insertPageRoute() defined?
insertPageRoute() is defined in packages/astro/src/container/index.ts at line 563.

Analyze Your Own Codebase

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

Try Supermodel Free