UNPKG

@h4ad/serverless-adapter

Version:

Run REST APIs and other web applications using your existing Node.js application framework (NestJS, Express, Koa, Hapi, Fastify and many others), on top of AWS, Azure, Digital Ocean and many other clouds.

2 lines 576 B
import{g as d,h as p,z as c}from"./chunk-6BLWJRLG.mjs";import{a as n}from"./chunk-QWPVIX2T.mjs";var a=class{static{n(this,"RawRequest")}onRequestCallback(e,t){return(r,s)=>{let o=this.getRequestFromExpressRequest(r);return t.sendRequest(e,o,s)}}getRequestFromExpressRequest(e){let t=e,r=p(e.headers,",",!0),s=r["x-forwarded-for"],o;if(t.body&&typeof t.body=="object"){let m=JSON.stringify(t.body),[f,u]=d(m,!1);o=f,r["content-length"]=String(u)}return new c({method:e.method,url:e.url,body:o,headers:r,remoteAddress:s})}};export{a}; //# sourceMappingURL=chunk-IYN5OKEG.mjs.map