Home / Function/ createDefaultRoutes() — astro Function Reference

createDefaultRoutes() — astro Function Reference

Architecture documentation for the createDefaultRoutes() function in default.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  ced0ae7a_236d_d4ba_5555_d308a335cc4a["createDefaultRoutes()"]
  aff8ca19_ee2c_80fd_1daf_24c72a8b3fad["default.ts"]
  ced0ae7a_236d_d4ba_5555_d308a335cc4a -->|defined in| aff8ca19_ee2c_80fd_1daf_24c72a8b3fad
  style ced0ae7a_236d_d4ba_5555_d308a335cc4a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/core/routing/default.ts lines 20–36

export function createDefaultRoutes(manifest: SSRManifest): DefaultRouteParams[] {
	const root = new URL(manifest.rootDir);
	return [
		{
			instance: default404Instance,
			matchesComponent: (filePath) => filePath.href === new URL(DEFAULT_404_COMPONENT, root).href,
			route: DEFAULT_404_ROUTE.route,
			component: DEFAULT_404_COMPONENT,
		},
		{
			instance: createServerIslandEndpoint(manifest),
			matchesComponent: (filePath) => filePath.href === new URL(SERVER_ISLAND_COMPONENT, root).href,
			route: SERVER_ISLAND_ROUTE,
			component: SERVER_ISLAND_COMPONENT,
		},
	];
}

Domain

Subdomains

Frequently Asked Questions

What does createDefaultRoutes() do?
createDefaultRoutes() is a function in the astro codebase, defined in packages/astro/src/core/routing/default.ts.
Where is createDefaultRoutes() defined?
createDefaultRoutes() is defined in packages/astro/src/core/routing/default.ts at line 20.

Analyze Your Own Codebase

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

Try Supermodel Free