nest-profiler-routes
Inspect the application routing table in a Symfony-Routing-style Routes panel.
@eleven-labs/nest-profiler-routes
@eleven-labs/nest-profiler-routes adds a Routes panel to the profiler home page — a Symfony-Routing-style view of the application's routing table. Every registered route is listed with its HTTP method, full path and controller/handler; a lock marks routes protected by a guard. Expanding a route reveals its guards, path params, query params, request headers, and the body DTO (class name, decorated properties, TypeScript types and, when class-validator is installed, the validation rules).

Installation
pnpm add @eleven-labs/nest-profiler-routes@alphaThere is no stable release yet — install every
@eleven-labs/nest-profiler*package with the@alphadist-tag (@latestresolves to nothing).
Peer dependencies: @eleven-labs/nest-profiler. class-validator is an optional peer — install it to surface DTO properties and validation rules; without it, a body DTO shows only its class name.
Setup
import { ConditionalModule } from '@nestjs/config';
import { RoutesCollectorModule } from '@eleven-labs/nest-profiler-routes';
const isProfilerEnabled = (env: NodeJS.ProcessEnv) => env['PROFILER_ENABLED'] === 'true';
@Module({
imports: [ConditionalModule.registerWhen(RoutesCollectorModule.forRoot(), isProfilerEnabled)],
})
export class AppModule {}Enabling / disabling — gate the collector with
ConditionalModule.registerWhen(..., isProfilerEnabled)so it loads only when the profiler is on, or passRoutesCollectorModule.forRoot({ enabled: false }). Wire the coreProfilerModuleonce at the root (add itsProfilerNoopModulefallback only if you injectProfilerServicedirectly) — see the example app.
What it collects
At application startup, the panel discovers every registered route and groups it by transport. The core ships a built-in REST source; other transport packages contribute their own group — GraphQL resolvers (@eleven-labs/nest-profiler-graphql), RabbitMQ subscribers (@eleven-labs/nest-profiler-rabbitmq) and CLI commands (@eleven-labs/nest-profiler-commander) — by registering a ProfilerRouteSource with the core, so they appear automatically when installed.
Each REST route is introspected from its decorator metadata:
- Guards — the guard classes from
@UseGuards()on the controller and/or handler (e.g. an authentication guard); guarded routes show a lock. Only route-level guards are visible — a globalAPP_GUARDis not attached per handler. - Path params — from the route path (
/users/:id→id). - Query params — from
@Query('name')and whole-object@Query()DTOs. - Headers — from
@Headers('name'). - Body DTO — from
@Body(): the DTO class name, its top-level decorated properties with their TypeScript types, and (withclass-validator) the validation rules per property.
Introspection is top-level only: a property that is itself a DTO surfaces as its class name rather than being expanded.
Contributing a custom route source
Any package can add its own group to the panel by registering a ProfilerRouteSource with the core (mirroring how entrypoint types are registered):
import { ModuleRef } from '@nestjs/core';
import { ProfilerCoreService } from '@eleven-labs/nest-profiler';
import type { ProfilerRouteSource } from '@eleven-labs/nest-profiler';
// in a module lifecycle hook:
const core = this.moduleRef.get(ProfilerCoreService, { strict: false });
core.registerRouteSource(mySource satisfies ProfilerRouteSource);License
MIT © Eleven Labs