Docs - Dispatcher

The dispatcher is responsible for handling request and response, next to this, in raddish the dispatcher will also send the needed data to the controller.

Default behavior

Within the dispatcher it is the default behavior to send you to the controller having the same name as the component whenever there is no view name specified. This default behavior can be overridden with an object override or a component config value.

Also by default the dispatcher handles the user authentication. and it will search to the authenticator with the name default. This as well can be overridden in an object override or a component config value.

When for the controller and the authenticator only an name is given instead of a complete identifier, it will search for the object using the the identifier of the dispatcher.

An example of an object override and component config:

var Dispatcher  = require('raddish').Dispatcher;
var util        = require('util');

function DemoDispatcher(config) {, config);

util.inherits(DemoDispatcher, Dispatcher);

DemoDispatcher.prototype.initialize = function(config) {
    config.controller = 'foo';
    config.authenticator = 'bar';

    return, config);

module.exports = DemoDispatcher;
    "dispatcher": {
        "controller": "foo",
        "authenticator": "bar"