title: botframework hosted in AWS API Gateway
body: <p>I have been trying to deploy my botframework bot in to AWS API Gateway. I am using the <strong>aws serverless express</strong> framework to host this application.</p>
  
  <p>The only thing I can find is this conversation which gives some good ideas on how to get this working.</p>
  
  <p><a href="https://gitter.im/Microsoft/BotBuilder?at=57832060bdafd191075d92b3" rel="nofollow noreferrer">https://gitter.im/Microsoft/BotBuilder?at=57832060bdafd191075d92b3</a></p>
  
  <p>The suggestion from the above was to pass to the request to listener function which work well</p>
  
  <pre><code>{ body:{}, headers: {} } 
  </code></pre>
  
  <p>and use the following for the response where end can be a no-op.</p>
  
  <pre><code>{ status: function (code) {}, end: () {} }
  </code></pre>
  
  <p>My code that runs but doesn't receive a response from the bot is this.</p>
  
  <pre><code>var connectorListener = connector.listen();
  function listen() {
      return function (req, res) {
  
          var response = res;
          connectorListener(req, { status: (code) =&gt; { response.status(code); }, end: () =&gt; { response.end(););
      }
   }
  </code></pre>
  
  <p>If I remove res.end() and leave as a no op as suggested I get a response back from the chatbot in 1-2 seconds, but it also makes the lambda run for 30 seconds which is the timeout for API Gateway. </p>
  
  <p>Is there a way to make this work so I can receive messages back without making the lambda timeout?</p>