Skip to content

Instantly share code, notes, and snippets.

@rudiedirkx
Created August 26, 2012 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rudiedirkx/3478362 to your computer and use it in GitHub Desktop.
Save rudiedirkx/3478362 to your computer and use it in GitHub Desktop.
Nodejs requirable secrets
// <?php /*
exports.user = 'root';
exports.password = 'secret password';
exports.database = 'games';
// */
var dbConfig = require('./dbsecrets.js.php');
// Nodejs now knows dbConfig.password
// If you go to ..../dbsecrets.js.php in the browser, you won't see anything.
// Obscure javascript?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment