@nova-ts/core
Version:
A serverside framework used to build scalable application
30 lines (28 loc) • 726 B
JavaScript
import {
ControllerRegistry
} from "./chunk-A45SEU4H.js";
// src/Decorators/GetMapping.ts
function GetMapping(path) {
return function(target, propertyKey, descriptor) {
if (!ControllerRegistry.has(target.constructor)) {
ControllerRegistry.set(target.constructor, {
mapping: "",
routes: []
});
}
const controller = ControllerRegistry.get(target.constructor);
if (controller) {
controller.routes.push({
method: "get" /* GET */,
path,
handlerName: propertyKey
});
} else {
console.warn(`Controller not registered for method ${propertyKey.toString()}`);
}
};
}
export {
GetMapping
};
//# sourceMappingURL=chunk-IJPCOGWY.js.map