express-decorated-router
Version:
Define Express routes using TypeScript decorators
16 lines (15 loc) • 655 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const ExpressDecoratedRouter_1 = require("../../ExpressDecoratedRouter");
/**
* Use this handler for the given HTTP method. The method must be one understood by Express' router.METHOD() method
* @see https://expressjs.com/en/4x/api.html#router.METHOD
* @param httpMethod The HTTP method
* @param path The path this handler will be responsible for
*/
function Method(httpMethod, path) {
return (target, _key, descriptor) => {
ExpressDecoratedRouter_1.ExpressDecoratedRouter.addRoute(target, httpMethod, path, descriptor.value);
};
}
exports.Method = Method;