API - Application

The Application object holds the information about every application, including the config for the component and config directories.

Methods

This method will teturn application instance bound to the given object.

Parameters
Name Type Description
alias String The alias of the application.

Returns Application: The application registred to the alias.

This method will try to match an application to the url, If no application is found an error will be fired. If the application isn't found it will throw a RaddishError.

Parameters
Name Type Description
url Object The url object of the (parsed) request.

This method will try to find the component and will run it. If the component isn't found it will throw a RaddishError.

Parameters
Name Type Description
component String The component to search for.
req Object NodeJS request object.
res Object NodeJS response object.

This method will try to get the application module and add this to the applications registry.

Parameters
Name Type Description
alias String The alias of the Application.
path String The path to the Application file.

Returns Application: The application object for chaining purposes.

The setConfig method will set the config for the current Application object.

Parameters
Name Type Description
config Object The config object for the Application

Returns Application: The application object for chaning purposes.