Closed ryanfitz closed 12 years ago
create a compiler for json files to generate javascript configs. Use NODE_ENV to compile out the proper config sections (process.env.NODE_ENV) for example
// filename: assets/config.json "development" : { "database" : "mongo://127.0.0.1:7000", "host" : "http://localhost" }, "production" : { "database" : "mongo://db.production.com:7000", "host" : "http://www.production.com" }
when running as NODE_ENV=production then compile out to:
NODE_ENV=production
// filename: js/config.js define("js/config", [ "require", "module", "exports" ], function(require, module, exports) { module.exports = { "database" : "mongo://db.production.com:7000", "host" : "http://www.production.com"} });
create a compiler for json files to generate javascript configs. Use NODE_ENV to compile out the proper config sections (process.env.NODE_ENV) for example
when running as
NODE_ENV=production
then compile out to: