UNPKG

serverless-aws-lambda

Version:

AWS Application Load Balancer and API Gateway - Lambda dev tool for Serverless. Allows Express synthax in handlers. Supports packaging, local invoking and offline ALB, APG, S3, SNS, SQS, DynamoDB Stream server mocking.

2 lines (1 loc) 2.37 kB
"use strict";var c=Object.defineProperty,U=Object.defineProperties,w=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyDescriptors,k=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var E=t=>{throw TypeError(t)};var u=(t,e,s)=>e in t?c(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,x=(t,e)=>{for(var s in e||(e={}))v.call(e,s)&&u(t,s,e[s]);if(g)for(var s of g(e))B.call(e,s)&&u(t,s,e[s]);return t},P=(t,e)=>U(t,y(e));var L=(t,e)=>{for(var s in e)c(t,s,{get:e[s],enumerable:!0})},_=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of k(e))!v.call(t,i)&&i!==s&&c(t,i,{get:()=>e[i],enumerable:!(r=w(e,i))||r.enumerable});return t};var j=t=>_(c({},"__esModule",{value:!0}),t);var R=(t,e,s)=>e.has(t)||E("Cannot "+s);var o=(t,e,s)=>(R(t,e,"read from private field"),s?s.call(t):e.get(t)),l=(t,e,s)=>e.has(t)?E("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),G=(t,e,s,r)=>(R(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s);var b=(t,e,s)=>new Promise((r,i)=>{var p=h=>{try{I(s.next(h))}catch(f){i(f)}},d=h=>{try{I(s.throw(h))}catch(f){i(f)}},I=h=>h.done?r(h.value):Promise.resolve(h.value).then(p,d);I((s=s.apply(t,e)).next())});var A={};L(A,{Server:()=>m,exitEvents:()=>T});module.exports=j(A);var C=require("child_process");var T=["exit","beforeExit","uncaughtException","unhandledRejection","SIGHUP","SIGINT","SIGQUIT","SIGILL","SIGTRAP","SIGABRT","SIGBUS","SIGFPE","SIGUSR1","SIGSEGV","SIGUSR2","SIGTERM"],S,a,n,m=class{constructor(e){l(this,S);l(this,a,T);l(this,n);G(this,n,e!=null?e:{})}start(){return b(this,null,function*(){o(this,a).forEach(r=>{process.on(r,()=>{this.stop()})});let e=["aws-lambda"];o(this,n).stage&&e.push("-s","dev"),o(this,n).watch||e.push("-w","false");let s=P(x({},process.env),{PORT:o(this,n).port});return o(this,n).debug&&(s.SLS_DEBUG="*"),G(this,S,(0,C.fork)(`${process.cwd()}/node_modules/serverless/bin/serverless`,e,{env:s})),o(this,S).on("message",({rebuild:r})=>{var i,p;r&&((p=(i=o(this,n)).onRebuild)==null||p.call(i))}),new Promise((r,i)=>{o(this,S).on("message",({port:p,ip:d})=>{p&&r({port:p,ip:d})})})})}stop(){var s;return(s=o(this,S))==null?void 0:s.kill()}};S=new WeakMap,a=new WeakMap,n=new WeakMap;0&&(module.exports={Server,exitEvents});