Skip to main content

Function: staticRouteParams()

staticRouteParams(store): Promise<object[]>

Defined in: staticRouteParams.ts:22

Every published route that can be prebuilt, shaped as the params a catch-all segment's generateStaticParams returns.

Parameters

store

ArtifactStore

The store the routes were published through. Only manifest is called, and it is read once per build rather than per request.

Returns

Promise<object[]>

One { slug } per exact pointer, in whatever order the manifest came back in; the root route is { slug: [] }. A param or prefix pointer — /guides/[city], /docs/* — is left out, because its route string is a pattern rather than a path and prebuilding it would name a page that does not exist.

Throws

Whatever the store raises reading its manifest. An empty manifest is an empty array, which is a build that prebuilds nothing rather than a failure.

Example

export const generateStaticParams = () => staticRouteParams(store);