Jamal
Jamal•4mo ago

deployment env

Do convex functions respect process.env.NODE_ENV === 'development' in node? I would like to have different logic for my production and development inside of my functions environment.
3 Replies
lee
lee•4mo ago
Nope, i believe it is "development" everywhere. We recommend you set your own env variable, different in dev vs prod. You can use those in node. (Although actually having different behavior in dev vs prod is an antipattern)
COCPORN
COCPORN•4mo ago
This is alarming. I have some mutations for cleaning up tables that are set to check process.env.NODE_ENV that were shared on this Discord expecting it to work, but it does indeed list out "development" in production also. Well, time to tighten that down with custom variables, thanks for the tip!
Jamal
JamalOP•4mo ago
glad to help 😄 okay thanks good to know

Did you find this page helpful?