0

It seems like the environment variables in app.yaml are rendered in Python-like strings, where booleans like true become True and empty variables becomes None. Anyone have ideas on how to make it play nice with javascript without doing explicit conversion for all my variables?

const MY_ENV_VAR = (process.env.MY_ENV_VAR === 'None') ? null : process.env.MY_ENV_VAR;

Yes, I can write some function to do it. Wondering if anyone has a clever solution.

ahong
  • 1,041
  • 2
  • 10
  • 22

1 Answers1

0

The only additional available configurations related to Javascript are for Node.js and they are quite simple. As per the official documentation of the app.yaml file, the option Javascript related is to set the runtime and that's it, unfortunately. There is not direct way to configure better usage for the environment variables.

Considering that and that, I agree with you, having better handling of environemt variables in Javascript would be better for a lot of cases. Due to that, I would recommend you to raise a Feature Request in Google's Public Issue Tracker, so they can take a look at it and verify the possibility of implementing it in the future.

Let me know if the information helped you!

gso_gabriel
  • 4,199
  • 1
  • 10
  • 22
  • Hi @ahong please, consider upvoting or accepting this answer, in case it helped you in anyway, to solve your problem. – gso_gabriel Apr 27 '20 at 12:44