How to Restrict an API to certain HTTP Methods only

How to Restrict an API to certain HTTP Methods only. Not applicable ones should return 405. Does wappler have anything which can do this without having to use a condition for each api?

Thats sounds like a job for .htaccess?

It would be easier if wappler could handle this, otherwise, every change would require changes in those files as well. This can be achieved using a Condition and then a response with 405. i wanted to know if wappler has anything inbuilt to do this.

Sounds like a good use case for a custom extension.

Build an action that reads the req method and if it is not authorized send a 405 response.

The enum UI control fits for this.

Sorry if this is stating the obvious, but if the logic is always the same you can place it all in a library action and then just include on the api. And if it applies to everything, you have Globals.