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
Percy15mo ago
Project ID: N/A
RyanKnack15mo ago
Brody15mo ago
pretty damn sure NODE_ENV does get set to production, because I know for a fact CI gets set to true