UNPKG

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) 376 B
import { Log } from "../utils/Log"; export const Controller = (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); } }; };