-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CORS headers in preview mode #1583
Comments
Would be great to have something like https://vitejs.dev/config/server-options.html#server-proxy |
@lfkpoa Interesting! Are you using Framework’s preview server in production rather than just for development preview? I would love to hear more about how your setup so I can better understand this use case. 🙏 |
Hi @mbostock We try to use the preview server while developing and testing only. |
hi the same here I try observable framework and I need to some modification to call some oxternal api and I always get this and I use this "dev": "tsx watch --ignore docs --no-warnings=ExperimentalWarning ./src/bin/observable.ts preview --no-open" to run my observable |
@kzmKZuzmo That sounds unrelated to this issue and like you should move your request to the oexternal API into a data loader. Alternatively you need to enable CORS to your test.test server, not to the Framework preview server. |
@mbostock so maybe you can help me What I need is write directly data into duckdb wasm without storing on the server only inside client is that possible ? |
@kzmKZuzmo Please open a new discussion if you’d like to ask for help on another topic. |
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:
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.
The text was updated successfully, but these errors were encountered: