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
Previously we had the following code written in our index.js which was restricting us to create post request API: