Skip to content

createEndpoint accepts 2 arguments and uses GET as method.#24

Open
endel wants to merge 1 commit intobetter-auth:mainfrom
endel:default-GET-method
Open

createEndpoint accepts 2 arguments and uses GET as method.#24
endel wants to merge 1 commit intobetter-auth:mainfrom
endel:default-GET-method

Conversation

@endel
Copy link
Copy Markdown

@endel endel commented Jun 30, 2025

This PR is meant to make it easier and more intuitive to define GET methods, by making it optional to specify { method: "GET" } as second argument:

const endpoint = createEndpoint("/something", async (ctx) => {
  return { ... };
});

Previously, the user would need to specify the method as option in the second argument:

const endpoint = createEndpoint("/something", { method: "GET" }, async (ctx) => {
  return { ... };
});

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 participants