Im curious how people architect their api gateways.
Do you use a single function per action route? e.g
a. POST /collections
b. PUT /collections
A single function per route? (pull in a router?) e.g
a. ANY /collections
single function (pull in a router)? e.g
a. ANY /*
For now ive used method 1 where i have a single function per action and route, but thats because my api only had 1 endpoint. I need a add a few more endpoints now and im trying to decide how i should design this. Would like to know what peoples preferences are and why
As with most things there are pros and cons, a reduction in complexity / moving parts. But some people like having Lambda functions with a singular responsibility so that that logstream only has data relevant to that particular code path for example