dbos-inc / dbos-transact-ts

The TypeScript framework for backends that scale
https://docs.dbos.dev
MIT License
346 stars 22 forks source link

Substitute environment variables during dbos executor init #610

Closed maxdml closed 3 weeks ago

maxdml commented 3 weeks ago

Currently we only substitute env vars during a deploy to the cloud. We should help local dev by doing it for a local transact too.

Code:

    // Set configured environment variables
    if (config.env) {
      for (const [key, value] of Object.entries(config.env)) {
        if (typeof value === "string") {
          process.env[key] = value;
        } else {
          console.warn(`Invalid value type for environment variable ${key}: ${typeof value}`);
        }
      }
    }