OutputHandler Class
This is an object used as the single pathway for data to leave a mojit action execution. It is used as a component of the ActionContext object, which uses it to call done and flush in order to complete.
There are two versions of this object, one for the client, and one for the server. This is the server version, which is more complex than the client version.
Constructor
OutputHandler
-
req -
res -
next
Parameters:
-
reqObjectThe Request object.
-
resObjectThe Response object.
-
nextFunctionThe next function, which should be invokable.
Item Index
Methods
_configureAppInstance
-
app -
}
Adds Mojito framework components to the Express application instance.
Parameters:
-
appObjectThe Express application instance to Mojito-enable.
-
}Port: number,!~YUIDOC_LINE~! dir: string,!~YUIDOC_LINE~! context: Object,!~YUIDOC_LINE~! appConfig: Object,!~YUIDOC_LINE~! verbose: booleanoptions An object containing server options.
_configureYUI
-
Y -
store
Configures YUI with both the Mojito framework and all the YUI modules in the application.
Parameters:
-
YObjectYUI object to configure
-
storeObjectResource Store which knows what to load
Returns:
_makeMiddewareList
-
app_mw -
mojito_mw
A utility function for compiling a list of middleware
Parameters:
-
app_mwArrayMiddleware list specified by the app's applicatioon.json
-
mojito_mwArrayMiddeware list specified Mojito, in this file, by the MojitoServer.MOJITO_MIDDLEWARE property
Returns:
_renderChild
-
ac -
callback
Renders a child mojit based on a config called "child" and the "assets" collection specified in the specs.
Parameters:
-
acObjectAction Context Object.
-
callbackFunctionThe callback.
_useMiddleware
-
app -
dispatcher -
midDir -
midConfig -
middleware
A utility function to require middleware code, configure it, and tell express to use() it.
Parameters:
-
appObjectExpress app instance.
-
dispatcherFunctionDispatcher function wrapper, special case middleware.
-
midDirStringDirectory of user-specified middleware, if any.
-
midConfigObjectConfiguration object.
-
middlewareArrayMiddleware names, or pathnames.
createServer
-
options
Creates a properly configured MojitoServer instance and returns it.
Parameters:
-
optionsObjectOptions for starting the app.
Returns:
include
-
path
Allows the bin/mojito command to leverage the current module's relative path for initial startup loading.
Parameters:
-
pathStringThe path used to locate resources.
