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
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)
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!glad to help 😄
okay thanks good to know