Skip to content

Instantly share code, notes, and snippets.

@Alvai
Forked from Sitebase/heroku.js
Last active December 2, 2018 20:38
Show Gist options
  • Save Alvai/6845906f8c2cc11eeaaf0ba9517ac2c9 to your computer and use it in GitHub Desktop.
Save Alvai/6845906f8c2cc11eeaaf0ba9517ac2c9 to your computer and use it in GitHub Desktop.
Detect if node app is running on Heroku
// 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