reest
Version:
A library inspired by NestJS's elegance, specifically designed for efficient serverless API development on AWS Lambda. It streamlines the creation of microservices with automated Swagger documentation and enhanced decorator-based middleware support, makin
13 lines (10 loc) • 374 B
text/typescript
import { Log } from "../../utils/Log";
export const Route = (prefix: string = ""): ClassDecorator => {
return (constructor: Function) => {
Log(`${constructor.name} is registered`);
Reflect.defineMetadata("prefix", prefix, constructor);
if (!Reflect.hasMetadata("routes", constructor)) {
Reflect.defineMetadata("routes", [], constructor);
}
};
};