Unified devtools request handler.
Routes requests to the appropriate handler based on the URL path:
{basePath}/core/events
{basePath}/stream
{basePath}/clear
{basePath}
This lets you wire up a single catch-all route instead of three separate ones.
The incoming HTTP request
The DevtoolsPort instance
Devtools route options including base path and access policy
Response for the matched sub-route
// Next.js catch-all route: app/api/devtools/[[...path]]/route.tsimport { createDevtoolsRoute } from "@beignet/devtools";import { getDevtools } from "@/server";export const { GET, POST } = createDevtoolsRoute(getDevtools(), { basePath: "/api/devtools",}); Copy
// Next.js catch-all route: app/api/devtools/[[...path]]/route.tsimport { createDevtoolsRoute } from "@beignet/devtools";import { getDevtools } from "@/server";export const { GET, POST } = createDevtoolsRoute(getDevtools(), { basePath: "/api/devtools",});
Unified devtools request handler.
Routes requests to the appropriate handler based on the URL path:
{basePath}/core/events→ event list (GET){basePath}/stream→ live event stream (GET){basePath}/clear→ clear buffer (POST){basePath}→ dashboard UI (GET)This lets you wire up a single catch-all route instead of three separate ones.