-
-
Save Alvai/6845906f8c2cc11eeaaf0ba9517ac2c9 to your computer and use it in GitHub Desktop.
Detect if node app is running on Heroku
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For Testing | |
const isHeroku = () => { | |
if (process.env.NODE && process.env.NODE.indexOf('heroku') !== -1) { | |
return 'This is on Heroku'; | |
} | |
return 'This is not on Heroku'; | |
}; | |
// Not testing | |
const isHeroku = () => process.env.NODE && process.env.NODE.indexOf('heroku') !== -1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment