try
config = JSON.parse(fs.readFileSync('./config.json', 'ascii'))
catch e
util.debug("Could not parse configuration file.\n" + e.stack)
return
I have that in my node.js code and I have two config files”
- config.json.prod
- config.json.local
How can I specify that it should run the .local?
By the way, I’m using CoffeeScript
Yea, you certainly can. Checkout nodepad (great reference app):
https://github.com/alexyoung/nodepad/blob/master/app.js
The source comes from this blog series: http://dailyjs.com/2010/11/01/node-tutorial/
Edit: For example