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

[Workers] New Python Workers Example #14569

Merged
merged 4 commits into from
May 21, 2024
Merged

Conversation

megaconfidence
Copy link
Member

Copy link

cloudflare-pages bot commented May 14, 2024

Deploying cloudflare-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: c017f51
Status: ✅  Deploy successful!
Preview URL: https://23e930d4.cloudflare-docs-7ou.pages.dev
Branch Preview URL: https://docs-py-examples2.cloudflare-docs-7ou.pages.dev

View logs

Copy link
Contributor

@kodster28 kodster28 left a comment

Choose a reason for hiding this comment

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

Content-wise, lgtm

@megaconfidence
Copy link
Member Author

Please can you take a look @hoodmane. Thanks!

return _to_js(x, dict_converter=Object.fromEntries)

async def on_fetch(request):
cors_headers = {
Copy link
Contributor

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.

Copy link
Member Author

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>
@megaconfidence megaconfidence merged commit 4b415b3 into production May 21, 2024
7 checks passed
@megaconfidence megaconfidence deleted the docs/py-examples2 branch May 21, 2024 18:38
@hoodmane
Copy link
Contributor

Thanks @megaconfidence!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product:workers Related to Workers product size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants