@methodus/server
Version:
dynamic rpc components
23 lines • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
require("reflect-metadata");
const class_container_1 = require("../class-container");
let metadataKey = 'methodus';
/** the MethodConfig decorator registers the controller as a router
* @param {string} name - the identifier of the controller in the resolver.
* @param {Function[]} workQueueName - an array of middlewares to apply to this controller}
*/
function MessageConfig(name, workQueueName) {
return function (target) {
let existingMetadata = class_container_1.ClassContainer.get(name) || {};
existingMetadata.name = name;
let proto = target.prototype || target.__proto__;
if (target.methodus)
proto = target;
proto.methodus.name = name;
proto.methodus.workQueueName = workQueueName;
class_container_1.ClassContainer.set(name, existingMetadata);
};
}
exports.MessageConfig = MessageConfig;
//# sourceMappingURL=message-config.js.map