-
Notifications
You must be signed in to change notification settings - Fork 50
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
Conversation
sunank200
commented
Mar 5, 2024
- Modify the API's Server to Allow CORS
Deploying with Cloudflare Pages
|
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": "*"}}) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!