Environments
In the app/config/envs
are defined all the configurations for any of the environments of your app.
The all.js
file contains configurations common for all the environments.
An environment file with all the options has the following form:
var config = {
host: 'localhost',
http: {
port: 4242,
socket: true
},
https: {
enabled: true,
port: 4243,
socket: true
},
methodOverride: {
enabled: true,
attributeName: 'newMethod',
},
database: {
enabled: true,
defaultAdapter: ''
},
log: {
//The name of the logging level,
//For more info, see WolverineJS documentation: https://github.com/talyssonoc/wolverinejs
level: 'debug',
//if undefined, will print to the terminal
output: '/home/rhapsody/log.log',
//If true, will print the error stack if an Error object is passed as argument in some log method
printStack: false,
//If true, show the debug level before the message
printLevel: true,
//If true, shows the time the log was logged before the level name
printTime: true,
//If true, show and file and the line number of where the log was called
printFileInfo: true,
driver: undefined
},
routes: {
//Controller used when access the app's root
mainController: 'main',
//View used when the user doen't specify it
mainView: 'index',
//If must be created REST routes for models
allowREST: true
},
globals: {
models: false //Allow to set the models as globals, so you don't need to use Rhapsody.requireModel() (defaults to false)
},
//If true, uploaded files via form will be at req.file
upload: {
enabled: true,
},
compression: {
enabled: true
},
//See CSFR session to see how it works
csrf: {
enabled: false
},
clientModels: {
enabled: true,
//Adapter that generates userside models based on your models, defaults to rhapsodyjs-backbone https://github.com/rhapsodyjs/rhapsodyjs-backbone
adapter: undefined,
//Destination of the client models that has generateClientModels set to true relative to your app root (the folder there are `app.js`, `app` and `node_modules`)
//Defaults to 'app/public/models'
destination: undefined
},
//Enable it if you want that RhapsodyJS runs a process to each of your CPUs
//making your app more scalable
cluster: {
enabled: true
}
}
Important: Read the Warnings & know issues session.