auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
const axios = require("axios")
try {
// Delete the Host header before forwarding the request
delete $event.headers.host
await axios({
method: "POST",
url: process.env.EXTERNAL_SERVICE_ENDPOINT,
headers: {
"Content-Type": $event.headers["content-type"],
},
data: $event.body,
})
} catch (err) {
throw new Error("Request failed")
}