Handle different functions
sam local start-api will cost a lot of time so I found this project, but how can I handle different functions. If I have two files with two different functions fun1.handler and fun2.handler, how can I run one server to handle two functions
I've been experimenting with docker-compose having different containers in stay-open mode for each Lambda, and I figured that I'd just pass the endpoint url and ARNs for each Lambda to the calling program in a configuration file that I'd vary by platform (local, dev, test, prod). Is that what other people are doing? This way each Lambda is its own thing, but you can also choose to have the functions in the same folder and share layers for testing purposes. It would be great to have support for multiple lambdas in one engine with different function names.
Yeah, multiple endpoints is the supported method. Not sure I'll ever add support for multiple functions per container – it would mess with a lot of the semantics and fidelity of trying to match how Lambda works in reality (which is a function per container)
You could use a reverse proxy that sits in front of the containers and does the routing for you – then you'd only need a single endpoint from your app code