Skip to content
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

Modify the API's Server to Allow CORS #311

Closed
wants to merge 7 commits into from
Closed

Modify the API's Server to Allow CORS #311

wants to merge 7 commits into from

Conversation

sunank200
Copy link
Collaborator

  • Modify the API's Server to Allow CORS

Copy link

cloudflare-workers-and-pages bot commented Mar 5, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 00cc782
Status: ✅  Deploy successful!
Preview URL: https://50bb7649.ask-astro.pages.dev
Branch Preview URL: https://enable-cros.ask-astro.pages.dev

View logs

@davidgxue
Copy link
Contributor

What is adding allowing CORS for exactly? Can you add more details? I think svelte and slack api work just fine right now without it?

@@ -18,6 +19,8 @@

api = Sanic(name="ask_astro")

CORS(api, resources={r"/api/*": {"origins": "*"}})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general it is not a good practice to allow * wildcard origin. Specify a domain name or something here.

But why are we adding this? The current service works just fine without it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not adding it @davidgxue it was just for the hackathon as we were using dev API of ask-astro

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay sounds good. As long as you don't merge this in then that's cool!

@jlaneve jlaneve closed this Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants