Docs - Config
Applications written with Raddish are required to create a config.json which needs to be send to Raddish before starting. Below I will give an example config file, with more detail underneath.
- This object hold all the database connection information. By default behavior the "default" connection needs to be present. This one will be used when no other database connection is specified.
The router object holds the values for CORS requests, and hold custom defined routers. May the CORS values be clear for them selves otherwise you can check here: CORS Specification.
The routes however are something different. There are redirects and state urls, I will try to explain.
Simple complete url redirects: This is as simple as doing:
For automatic dynamic states you can do:
"/bar/:id": "/demo/menu/item"In this case the state id will automatically be set when available.
For complete redirects you can add:
"/baz/*": "/templates/css/"This will redirect everything with
This setting can only be false or an object.
When false (or not defined) ssl will not be started.
When it is an object key and cert are required and must point to the of the ssl key and ssl certificate files.
Can be true, false, not defined or an object,
when true it will start threads with the default values.
When an object it will override the default values with your custom values, displayed here are the default values.
minThresholdis the amount of usage a process might have before an extra thread is started or removed.
intervalis the interval in millisecond when the system must check for process usage.
The value can be true, an object, false or not defined.
When true it will start sockets on port 1338, when an object you can manually set the
portto start on.
With the logging object you can specify a logging object. Whenever an error is thrown the RaddishError object will log to this object.
For more details read here.
- Specify the path to the plugins directory. When not defined plugins will not be used in the system.
- This value can be true, false or not defined. When true it will cache the initialized objects resulting in a huge speed advantage. When false or not defined the system will not cache any objects.
- Enable gzip compression or not. When the client doesn't support gzip compression the result isn't compressed.
- This value is required. Specify the default returned value.
- This value is required. Specify on which port the system starts.
- This value is required. Specify the folder where the public files are stored. </dl>