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

handling post request for API #152

Open
vinayak-trivedi opened this issue Sep 21, 2023 · 1 comment
Open

handling post request for API #152

vinayak-trivedi opened this issue Sep 21, 2023 · 1 comment
Assignees

Comments

@vinayak-trivedi
Copy link
Contributor

Previously we had the following code written in our index.js which was restricting us to create post request API:

if (request.method === "POST") {
  const isVerifiedRequest = await verifyBot(request, env);
  if (!isVerifiedRequest) {
    console.error("Invalid Request");
    return new JSONResponse(response.BAD_SIGNATURE, { status: 401 });
  }
}

[this PR](https://github.com/Real-Dev-Squad/discord-slash-commands/pull/130) solved that issue for us, we can just add the endpoint of the APi to the array, and then we will be able to create the API which have post method

but this is not an ideal situation for us, as this can lead to a long list of endpoint being added to that array, we need to find a better solution for this
@ajoykumardas12
Copy link

I will take this task.
Providing ETA soon.

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

No branches or pull requests

2 participants