trek10inc / serverless-secrets

An opinionated tool for safely managing and deploying Serverless projects and their secrets.
Other
165 stars 27 forks source link

Fix process.env._HANDLER undefined #30

Open franciscocpg opened 6 years ago

franciscocpg commented 6 years ago

Fixes #22

azurelogic commented 6 years ago

Can you confirm that this works when there are multiple functions and the target function isn't the first one?

franciscocpg commented 6 years ago

Yes, I'll do it tomorrow.

Also I'm going to try with serverless-offline plugin.

franciscocpg commented 6 years ago

@azurelogic You were totally right about multiple functions.

So the best approach I found was to inject process.env._HANDLER just like AWS is doing on its environments.

Maybe @HyperBrain could give a quick look here too?

HyperBrain commented 6 years ago

In general, I think for the invoke local case, this would work (although it should be tested thoroughly first).

franciscocpg commented 6 years ago

@azurelogic I think the PR is ready for review now.

franciscocpg commented 6 years ago

Any news here?

ghost commented 6 years ago

Waiting for this PR to be merged..