UNPKG

lambda-request-handler

Version:

An npm module that allows your Node.js web applications to be deployed as an AWS Lambda function and invoked in response to API Gateway, HTTP API, or Application Load Balancer requests.

21 lines (20 loc) 665 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HapiListener = void 0; const events_1 = require("events"); class HapiListener extends events_1.EventEmitter { listen(_port, maybeCallback, maybeCallback2) { let callback = typeof maybeCallback === "function" ? maybeCallback : undefined; if (!callback) { callback = typeof maybeCallback2 === "function" ? maybeCallback2 : undefined; } if (callback) { callback(); } } get handler() { return (req, res) => this.emit("request", req, res); } } exports.HapiListener = HapiListener;