routeHandler
Esta página aún no está disponible en tu idioma.
Variables
Section titled “Variables”routeHandler
Section titled “routeHandler”const routeHandler: HookUtility<"astro:config:setup", [Options], void>;
Defined in: studiocms/packages/studiocms/src/routeHandler.ts:73^
Handles the dynamic injection of routes based on configuration options.
This utility is registered under the ‘astro:config:setup’ hook and is responsible for setting up all necessary routes for the application, including dashboard, authentication, API, and REST endpoints. Routes are conditionally enabled based on the provided options, such as dashboard status, authentication providers, demo mode, and extra custom routes.
Contains route injection utilities, such as injectRoute
.
Configuration options for route setup, including:
dbStartPage
: Whether the database start page is enabled.shouldInject404Route
: Whether to inject a 404 route.dashboardEnabled
: Whether the dashboard is enabled.dashboardRoute
: Function to resolve dashboard route patterns.developerConfig.demoMode
: Whether the application is in demo mode.extraRoutes
: Additional custom routes to inject.authConfig
: Authentication configuration, including enabled providers and registration settings.
The function builds a list of route definitions, conditionally enables them,
and injects each enabled route using the provided injectRoute
function.