Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix error in .gitignore

  • Loading branch information...
commit aebacc537c3d7e34679946dfe76e3bc3d1a440e7 1 parent 1b25c6e
@langpavel authored
Showing with 23 additions and 1 deletion.
  1. +1 −1  .gitignore
  2. +22 −0 app/config.js
View
2  .gitignore
@@ -15,7 +15,7 @@ node_modules
npm-debug.log
static/css/*.css
*.pyc
-config*.js
+/config*.js
!config*.example.js
!static/css/bootstrap.css
!static/css/bootstrap-responsive.css
View
22 app/config.js
@@ -0,0 +1,22 @@
+
+/*
+ * Load config from package root directory
+ * Loads ../config-{NODE_ENV} file
+ * NODE_ENV defaults to "development" if not set
+ */
+
+var pkgname = require('../package').name;
+var debug = require('debug')(pkgname + ':config');
+
+try {
+
+ var env = (process.env.NODE_ENV || 'development');
+
+ // try load environment specific config
+ var env_config_name = '../config-' + env;
+ module.exports = require(env_config_name);
+ debug('environment: ' + env);
+
+} catch (err) {
+ throw new Error('Config: Failed to load \'' + env_config_name + '\': ' + err);
+}
Please sign in to comment.
Something went wrong with that request. Please try again.