-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[Workers] New Python Workers Example #14569
Conversation
Deploying cloudflare-docs with Cloudflare Pages
|
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.
Content-wise, lgtm
Please can you take a look @hoodmane. Thanks! |
return _to_js(x, dict_converter=Object.fromEntries) | ||
|
||
async def on_fetch(request): | ||
cors_headers = { |
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.
Could you move most of the body of on_fetch
to top level definitions?
e.g. cors_headers
, api_url
, raw_html_response
, handle_request
, handle_options
? As far as I can tell none of them are closing over per-request data so it's nice to have them in the top level.
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.
That makes sense, but I'm thinking of leaving it in to keep the examples consistent across languages
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Thanks @megaconfidence! |
Adds new example for: