mardi 8 septembre 2015

AWS Elastic Beanstalk randomly decided to error on CORs requests

As of last Friday, my Node application was working when making CORs requests to the EB instance. This morning (or sometime this weekend) the server decided to start throwing 502 bad gateway issues.

Here is my config file in my Hapijs app:

{
    "manifest": {
        "connections": [
            {
                "port": 8081,
                "routes": {
                    "cors": true
                },
                "router": {"stripTrailingSlash": true}
            }
        ],
        "server": {
            "cache": {
                "expiresIn": 30000,
                "engine": "catbox-memory"
            }
        },
        "plugins": {
            "hapi-auth-bearer-token": null,
            "./src/db": null,
            "./src/utilities": null,
            "./src/set-hero": null,
            "./src/health": null,
            "good": {
                "reporters": [
                    {
                        "reporter": "good-console",
                        "events": { "log": "*", "response": "*", "ops": "*", "error": "*" }
                    }
                ]
            }
        }
    }
}

I am manually listening to the process.env.PORT here in my main index.js file: server.connection({ port: process.env.PORT || 8067 });

Im not sure whats wrong




Aucun commentaire:

Enregistrer un commentaire