Skip to content

Specifying environment and config file prepends undefined process variable #105

Description

@sandromartis

Hey

I'm not sure if I understand the purpose of the environment setting correctly, but when I specify the environment with an according config file, e.g.
node-lambda deploy -f staging.env -e staging
Then node-lambda prepends a process variable to my index.js:

////////////////////////////////////
// "Environment Variables"
process.env["environment"]=staging;
process.env["MY_CUSTOM_VARIABLE"]="my_custom_variable";
////////////////////////////////////

Unfortunately staging is not defined which makes the script fail when trying to run it on lambda.

Is there something that I don't understand properly regarding environments and config files or is this a bug?
What exactly is the purpose of the environment setting?
How I understand it, only the lambda function name will be changed and the process.env["environment"] will get added. Or is there anything else happening?

The thing is, that for different environments (development, staging, production) I want to have different .env files. Is this actually possible?

Thanks for clarifying.

Best,
Sandro

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions