Created
February 12, 2015 22:30
-
-
Save Sitebase/9e2ac2d3f0034382addf 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
function isHeroku() | |
{ | |
return process.env.NODE && ~process.env.NODE.indexOf("heroku") ? true : false; | |
} |
Thanks for the gist, it's working but i changed it a little bit to work really properly process.env.NODE.indexOf('heroku') !== -1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For your information, this is not working.
This solution however worked for me.