I am coming from aws lambda where we generally have full control over the function and api gateway
How can I authenticate each of my function before execution? The client passes a bearer token in the headers. I could write a auth script for each function, but if I have 30+ functions, that would be a mess and it would make sense to separate business logic and auth logic
I know that functions are independent of each other, but it seems that all of my functions will need some kind of initialization such as a CORS setting and a AUTH script.
I guess the same question applies to all cloud functions like vercel/netlify/cloudflare etc, where there isn’t a api gateway to manage them.
Any suggestion where i can write code once that will cover all my functions?
Thanks. I would still need to write auth logic from the context to check if the token is valid or not. maybe not as much but still need to do it for many end points. hope Netlify can implement an api gateway.