Function rewrites based on HTTP method for REST API

Hiya @parkan and welcome to our community!

Could I ask why you don’t just write one function for /widgets that handles POST, GET, DELETE, PUT, etc differently? No routing needed :slight_smile: . I think the customer you refer to in the post where DELETE/PUT weren’t working figured out that they were wrong about that (cf their recent response).

The “Method” condition you created will not do anything as our service doesn’t even parse that line, being as it is not something we’ve implemented. There is no Method-based routing here at present; it will be unlocked by this work if you’d like to sign up for the beta: https://www.netlify.com/products/edge/edge-handlers/

I guess your other option is to create a separate function for each call; doesn’t really need any fancy routing, is just a different call for each functionality. I don’t love it personally - I’d use the first pattern instead.