Skip to content

Add Cors options for Restful Endpoints #22

@FilledStacks

Description

@FilledStacks

The package uses the express router. We should probably be able to enable CORS like in Google's example:
https://firebase.google.com/docs/functions/http-events#using_existing_express_apps

Or somehow be able to define CORS configuration for each function / route:
https://github.com/expressjs/cors#enable-cors-for-a-single-route

This can be implemented either or in both ways but it is something that will be required. I don't know the security concerns with setting cors enabled to true for all functions so:

  • We should default to cors enabled false
  • Add an option to the function parser to set the default true for all Restful functions.

This will make it so that the devs that want it on for everything can do that, the ones that don't won't have to change anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions