Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Introduce LocalLambdaGroup to manage multiple lambdas in a single server instance #20

Merged
merged 3 commits into from
May 7, 2023
Merged

feat: Introduce LocalLambdaGroup to manage multiple lambdas in a single server instance #20

merged 3 commits into from
May 7, 2023

Conversation

thapabishwa
Copy link
Contributor

@thapabishwa thapabishwa commented Apr 21, 2023

This PR refactors the LocalLambda class to use express.Router() and adds a new LocalLambdaGroup class for managing multiple lambdas.

The LocalLambda now uses an instance of express.Router() for handling requests, and it includes options for setting binary content-type headers, request context, and enable CORS.

In addition, a new LocalLambdaGroup class has been added, which allows for multiple lambdas to be run simultaneously on the same server. It uses the LocalLambda class under the hood to handle each lambda's requests.

Both LocalLambda and LocalLambdaGroup have a run() method that starts the server and listens for incoming requests. The LocalLambda instance can also be created separately if needed.

I have tested this implementation thoroughly and all existing tests are passing. Please let me know if there is anything else I can do to help merge this PR.

PS. Based on my assessment, it would be best to hold off merging this PR until after #19 has been merged, as there may still be some additional work required on this PR. Therefore, I recommend deferring the merge until after the other PR has been completed.

@vcfvct vcfvct requested review from blakejoy and vcfvct April 22, 2023 14:47
@vcfvct
Copy link
Owner

vcfvct commented Apr 22, 2023

Love the idea. Thanks for the contribution. 😄
other than the lodash comment at #19 , can you please move the LocalLambdaGroup and its related interfaces to its own ts file so that we have a better code organization?

@thapabishwa
Copy link
Contributor Author

thapabishwa commented Apr 23, 2023

Love the idea. Thanks for the contribution. 😄 other than the lodash comment at #19 , can you please move the LocalLambdaGroup and its related interfaces to its own ts file so that we have a better code organization?

Thank you for your feedback on my contribution. I'm glad you like the idea!

I've addressed your concerns. Let's merge this after #19

@vcfvct
Copy link
Owner

vcfvct commented Apr 27, 2023

sorry for the late reply, it was a busy week.
Looks like there's some merge conflict. Can you please merge/rebase it?

Thank you!

@thapabishwa thapabishwa reopened this Apr 28, 2023
@thapabishwa
Copy link
Contributor Author

Closed by accident. I've addressed to the comments you've made.

src/lambda.group.ts Outdated Show resolved Hide resolved
src/local.lambda.ts Outdated Show resolved Hide resolved
@thapabishwa thapabishwa requested a review from vcfvct May 7, 2023 14:22
Copy link
Owner

@vcfvct vcfvct left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks.

@vcfvct vcfvct merged commit 5129e4a into vcfvct:master May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants