Skip to content

Add CORS headers in preview mode #1583

@lfkpoa

Description

@lfkpoa

Hello,

We use Observable with API calls to a few different servers.
The users connect with their own ID to these servers to get the data if they are authorized.
But I can't use Observable Framework preview server while developing because of CORS.
When I create react apps with create-react-app, their preview server (npm start) adds CORS headers automatically and I can test the app:

access-control-allow-headers: *
access-control-allow-methods: *
access-control-allow-origin: *

So, I'm suggesting to add these CORS headers automatically to the preview server as well or, at least, add a config that enables this feature.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    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