Kind: Interface
Source: packages/common/interfaces/controllers/controller-metadata.interface.ts
Part of: Common
ControllerMetadata defines the metadata associated with a controller, currently consisting of its route path. Framework decorators or registration logic can use this interface to store and retrieve the base URL segment for controller instances.
Properties
| Property | Type |
|---|---|
path | string |
Diagram
mermaidgraph LR Controller["Controller Class"] --> Metadata["ControllerMetadata"] Metadata --> Path["path: string"] Path --> Router["Route Registration"]
Usage
tsimport type { ControllerMetadata } from './controller-metadata.interface';
const metadata: ControllerMetadata = {
path: '/users',
};
function registerController(controller: ControllerMetadata) {
console.log(`Registering controller at ${controller.path}`);
}
registerController(metadata);
AI Coding Instructions
- Keep
pathas a string representing the controller's base route path. - Use this interface when passing or storing controller-level routing metadata.
- Normalize route paths consistently in the router or decorator layer (for example, handling leading slashes).
- Avoid adding request-specific or method-specific metadata here; keep those concerns in separate interfaces.
Was this page helpful?