title: AWS Lambda to run in background even after sending response to API Gateway
body: <p>I have searched all through the net but didn't find a solution of how to make this functionality get succeeded. Require help.</p>
  
  <p>My requirement is: I want a that if I trigger an aws lambda function written in node.js and uses an aws-serverless-express module must send back response quickly to API gateway but still should not exit and still run in the backend and we could see cloud watch logs. It must be asynchronous.</p>
  
  <p>The code snippet is:</p>
  
  <pre><code>    app.get('/check', function(req, res){
       method.invoke(req)
       res.status(200).send('success')
     })
  </code></pre>
  
  <p>I did and checked like this but the lambda function gets stopped and returns the response to api gateway it didn't even runs the method.invoke() function in backend.</p>
  
  <p>Please correct me if anything I am understanding or doing wrong. I checked with this link: <a href="https://stackoverflow.com/questions/41102337/invoke-aws-lambda-and-return-response-to-api-gateway-asyncronously">Invoke AWS Lambda and return response to API Gateway asyncronously</a></p>
  
  <p>Is it the only way to do this problem. Creating two lambda functions.</p>