Skip to content

CORS support for multiple origins #483

@scottcorgan

Description

@scottcorgan

Because we have no access to the request object when setting up cors in the server configuration, I am unable to define multiple authorized origins.

var serverConfig = {
    cors: {
        origin: ['http://localhost:3000', 'http://localhost:8000']
    }
};

var server = new Hapi.Server(port, serverConfig);

If there's another way, can you please provide an example? Thanks so much!

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions