Skip to content

How can I use cors explicitly on specific routes only? #76

@patrick99e99

Description

@patrick99e99

The documentation for how this is used is shown as:

server.pre(cors.preflight);
server.use(cors.actual);

This would add cors for all endpoints in an application, which is not what I want. Instead, how can I add cors to only one specific route? In other words, say I want my server.get('/foo', fn) to use cors, but not server.get('/bar', fn) ... How can I do that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions