In my file app/controllers/activities.coffee I am trying to load my config file like this:
cfg = require '../config/config'
But I keep getting this error:
Error: Cannot find module '../config/config'
Here is what that file looks like (/config/config.coffee):
path = require 'path'
rootPath = path.normalize __dirname + '/..'
env = process.env.NODE_ENV || 'development'
config =
development:
root: rootPath
app:
name: 'app'
port: 3000
db: 'mongodb://localhost/app-development'
test:
root: rootPath
app:
name: 'app'
port: 3000
db: 'mongodb://localhost/app-test'
production:
root: rootPath
app:
name: 'app'
port: 3000
db: 'mongodb://localhost/app-production'
module.exports = config[env]
what if you try? ../../config/config