A server route configuration that uses Static Site Generation (SSG) mode, including support for routes with parameters.
interface ServerRoutePrerenderWithParams extends Omit<ServerRoutePrerender, 'fallback'> {}
fallback
PrerenderFallback | undefined
Optional strategy to use if the SSG path is not pre-rendered. This is especially relevant for routes with parameterized URLs, where some paths may not be pre-rendered at build time.
This property determines how to handle requests for paths that are not pre-rendered:
PrerenderFallback.Server
: Use Server-Side Rendering (SSR) to dynamically generate the page at request time.PrerenderFallback.Client
: Use Client-Side Rendering (CSR) to fetch and render the page on the client side.PrerenderFallback.None
: No fallback; if the path is not pre-rendered, the server will not handle the request.
getPrerenderParams
() => Promise<Record<string, string>[]>
A function that returns a Promise resolving to an array of objects, each representing a route path with URL parameters. This function runs in the injector context, allowing access to Angular services and dependencies.
path
string
The path associated with this route.
headers
Record<string, string> | undefined
Optional additional headers to include in the response for this route.
renderMode
Specifies that the route uses Static Site Generation (SSG) mode.