Last active
August 29, 2015 14:16
-
-
Save hellobrian/a0a201d7ea0ff93a9518 to your computer and use it in GitHub Desktop.
How to store API Keys in node process?
This file contains 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
// ./app.js | |
// My GitHub API credentials are all hardcoded in a credentials.js file | |
var credentials = require('./credentials'); | |
var GITHUB_CLIENT_ID = credentials.github.id; | |
var GITHUB_CLIENT_SECRET = credentials.github.secret; | |
var CALLBACK_URL = credentials.github.callback; |
This file contains 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
// ./credentials.js | |
// This file is in .gitignore so we don't check in any these keys. | |
module.exports = { | |
github: { | |
id: 'GITHUB_ID', | |
secret: 'GITHUB_SECRET', | |
callback: 'http://127.0.0.1:3000/auth/github/callback' | |
} | |
// other API Keys here; truncated for length. | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment