1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1x 1x 1x 11x 11x 11x | import { isUndefined } from '../../utils/shared.utils'; import { PATH_METADATA } from '../../constants'; /** * Defines the Controller. The controller can inject dependencies through constructor. * Those dependencies have to belong to the same module. */ export function Controller(prefix?: string): ClassDecorator { const path = isUndefined(prefix) ? '/' : prefix; return (target: object) => { Reflect.defineMetadata(PATH_METADATA, path, target); }; } |