swift-aws-lambda-runtime icon indicating copy to clipboard operation
swift-aws-lambda-runtime copied to clipboard

Local lambda invocation endpoint env var

Open jsonfry opened this issue 3 months ago • 1 comments

Allow the changing of the local lambda server's invocation endpoint

Motivation:

[Explain here the context, and why you're making that change. What is the problem you're trying to solve.]

As described in https://github.com/swift-server/swift-aws-lambda-runtime/issues/320 I want to be able to use other tooling that expects the local invocation endpoint to have a specific path, not just /invoke.

Modifications:

I have added an envionrment variable option that lets you override the invocation endpoint url.

Result:

If you set LOCAL_LAMBDA_SERVER_ENABLED to run locally, you can now also set LOCAL_LAMBDA_SERVER_INVOCATION_ENDPOINT to any value to change the path, e.g. to /2015-03-31/functions/function/invocations to match how the "runtime interface emulator" works.

jsonfry avatar Mar 19 '24 11:03 jsonfry

fixes #320

jsonfry avatar Mar 19 '24 11:03 jsonfry