We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
const app = function (req, res) { res.end('hello world') } const server = serverlessExpress.createServer(app) exports.handler = async (event, context) => { const result = await serverlessExpress.proxy(server, event, context) console.log(result) return result }
being the response:
{ "statusCode": 200, "body": "hello world", "headers": { "date": "Mon, 28 Dec 2020 10:50:26 GMT", "connection": "close", "content-length": "11" }, "isBase64Encoded": false }
However, as you can see on my code intention, I'm just interested in exposing body.
body
That's happening essentially because the default behavior is to expose all the information:
https://github.com/vendia/serverless-express/blob/master/src/index.js#L91
could be possible to provide a way to map the response? something like:
const result = await serverlessExpress.proxy(server, event, context, { responseMapper: ({ body }) => body })
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
being the response:
However, as you can see on my code intention, I'm just interested in exposing
body
.That's happening essentially because the default behavior is to expose all the information:
https://github.com/vendia/serverless-express/blob/master/src/index.js#L91
could be possible to provide a way to map the response? something like:
The text was updated successfully, but these errors were encountered: