Do you need to explicitly set NODE_ENV=production?

Surprisingly this wasnt answered in any of the forums ive seen here. I wonder if it is essential to set this environment variable in NodeJS? Ive seen that railway provides this variable in the form of RAILWAY_ENVIRONMENT=production. Will NodeJS use this variable and know if it is in production mode?
3 Replies
Percy
Percy15mo ago
Project ID: N/A
RyanKnack
RyanKnack15mo ago
N/A
Brody
Brody15mo ago
pretty damn sure NODE_ENV does get set to production, because I know for a fact CI gets set to true