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

refactor: update endpoint data return type #824

Merged
merged 7 commits into from
Jul 21, 2022
Merged

Conversation

adamdbradley
Copy link
Contributor

Previously endpoints such as onGet() would return an object with the status, headers and body.

This update allow the return of onGet() to just be the data (which becomes the http response body).

Additionally, the passed in arguments to onGet({ response }) provides a response property, which can be used to set the status and headers.

@adamdbradley adamdbradley enabled auto-merge (squash) July 21, 2022 16:20
@adamdbradley adamdbradley disabled auto-merge July 21, 2022 16:22
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jul 21, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 046dba3
Status:⚡️  Build in progress...

View logs

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.

1 participant