ts-lambda-local-dev
Version:
typescript lambda local development server
27 lines • 1.23 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LocalLambdaGroup = void 0;
const express_1 = __importDefault(require("express"));
const local_lambda_1 = require("./local.lambda");
class LocalLambdaGroup {
constructor(config) {
var _a, _b;
this.lambdas = [];
this.lambdas = config.lambdas;
this.app = (0, express_1.default)();
this.port = (_a = config.port) !== null && _a !== void 0 ? _a : local_lambda_1.DefaultPort;
this.defaultPath = (_b = config.defaultPath) !== null && _b !== void 0 ? _b : local_lambda_1.DefaultPathParamsPattern;
}
run() {
this.lambdas.forEach(lambda => {
const localLambda = new local_lambda_1.LocalLambda(lambda, this.app, this.defaultPath);
localLambda.createRoute();
});
this.app.listen(this.port, () => console.info(`🚀 Lambda Group Server ready at http://localhost:${this.port} at '${new Date().toLocaleString()}'`));
}
}
exports.LocalLambdaGroup = LocalLambdaGroup;
//# sourceMappingURL=lambda.group.js.map