Webapp Extensions
Ringo web apps provide an extension mechanism which allows to add additional protocols to the standard HTTP interface. The extension mechanism supports two callbacks which get called on server startup and server shutdown, respectively. Both are given the webapp's ringo/httpserver.Server instance as argument.
serverStarted(server);
serverStopped(server);
To register an extension for a webapp, export a property extensions from its config module that is an Array and contains the module names of the app's extnsions. For example, the following piece of code is taken from the config module of the ringo-cometd demo application:
exports.extensions = [
'ringo/cometd',
'chatService'
];
This first registers the ringo/cometd module as extension which installs the cometd servlet in the app's Jetty instance, then the application-specific chatService module which implements the actual chat.
