Routes Overview
Routes are defined by files in src-api/ and map directly to URLs.
- Static — plain files like
index.js,about.js - Dynamic —
users/[id].jsparameterized by segments - Catch-all —
docs/[...slug].jscaptures multiple segments - Remote — any route that fetches external data within
data()at build time
Every route module must provide data via:
export default <object>orexport async function data(ctx)
Dynamic/catch-all routes also provide:
export async function paths()to enumerate all concrete pages
Dynamic and catch-all routes can optionally emit a parent collection route with:
export const config = { listIndex: true }- or
export const config = { listIndex: { enabled: true, pick: [...] } }