-
Notifications
You must be signed in to change notification settings - Fork 0
Config
Luis Eduardo Brito edited this page Sep 4, 2013
·
4 revisions
The config directory stores all files that handle configuration static stuff, including connection strings and language classes.
Location: /config/general.js
The main config file is the general.js
and it handles basic application configs, such as the MongoDB connection params, the cache control and the logging level. It contains the configuration variables for the following entities:
- Log and Error Handling
- HTTP server deploy
- Cluster limitations
- Database credentials
module.exports = {
// define the application state
state: "development",
// define the available states
// and its configs...
// dev state: logging enabled, cache not
development: {
port: 3000,
cluster: {
max: 1
},
db: {
// mongodb connection strings
protocol: "mongodb://",
user: "root",
password: "",
db: "main",
host: "localhost"
}
},
// test state: logging and cache enabled
test: {
port: 3000,
cluster: {
max: 3
},
db: {
// mongodb connection strings
protocol: "mongodb://",
user: "root",
password: "",
db: "main",
host: "localhost"
}
},
// production state: cache enabled, logging not
production: {
port: 3000,
db: {
// mongodb connection strings
protocol: "mongodb://",
user: "root",
password: "",
db: "main",
host: "localhost"
}
}
}
Location: /config/socket.js
Socket.io server settings, used to comunicated mostly with the front-end sandbox and modules.
// todo: In roadmap, waiting for front-end publisher/subscriber pattern immprovements...