Google App Engine 502 (Bad Gateway) with NodeJS : <p>I have a full web application using NodeJS, MongoDB (Mongoose as the driver) and ExpressJS.</p>

<p>The project works perfectly on my local machine. Today I decided to move everything to production. I'm using Google App Engine to host my application, and Compose (formally MongoHQ) to host my database.</p>

<p>App Engine servers my application perfectly, although my API does not seem to work. My API is served from <code>example.com/api</code>, and each request (<code>GET</code>, <code>POST</code>, <code>DELETE</code> and <code>PUT</code>) all returns a 502 (Bad Gateway) error.</p>

<p>I tried running my application on my local machine while connected to my remote MongoDB database and that worked perfectly fine. So it must be a problem with App Engine or NodeJS, not with MongoDB.</p>

<p>I have tried checking all error logs within Google Cloud, although there are no errors.</p>

<p>Why is App Engine/NodeJS serving my application's static content perfectly fine, although not allowing any requests to my API?</p>
