Today we’ve released a new, minor version of the Server CLI, for all your scoped and unscoped environment variable needs.
Besides a version bump to the AWS-SDK dependency, this change implements the ability to define both scoped and unscoped environment variables for your server CLI projects, in a way that will feel both familiar and much more flexible.
Environment variables in the past have allowed you to define values which you may not want hardcoded in your source code. This new feature extends that capability, by allowing you to define values for a specific environment, while still being able to access your variables in regular Node.js fashion, using process.env.
Take for example, a database connection, or API endpoint, that differs between your dev, UAT and production environments. In the past, you would have had to define each of these as separate variables, and call them by their specific name. Now, you’re able to define scoped variables as an object, with a dev, test and prod value. How the code interprets this will be reliant on the --env flag used during the bm server deploy step.
As always, release documentation can be found via our GitHub, with package information located on NPM.Documentation GitHub NPM