express-composer
A composition library built by extending express
Modules
Module | Description |
---|---|
app | Extension module for an express app
|
express-composer | method for creating an express application with express-compose mixin |
Scope |
<a name="module_express-composer"></a>
express-composer
method for creating an express application with express-compose mixin
Example
var expressComposer = ;
- express-composer
- expressComposer() ⇒
app
⏏- static
- .extend(app) ⇒
app
- .handle(handlers, scopeProvider) ⇒
function
- .error(handlers, scopeProvider) ⇒
function
- .validate(validate, scopeProvider) ⇒
function
- .extend(app) ⇒
- inner
- ~scopeArg :
Object
|function
|Promise.<Object>
- ~requestHandlers :
function
|Array.<function()>
- ~pathArg :
String
- ~appOptions :
Object
- ~routerOptions :
Object
- ~requestMethod :
object
- ~requestMethods :
object
- ~routeScore :
Object
- ~routerScore :
Object
- ~appScore :
Object
- ~scopeArg :
- static
- expressComposer() ⇒
app
⏏
expressComposer() ⇒ Creates an extended express app
Kind: Exported function
Example
var express = app = ;
app
expressComposer.extend(app) ⇒ Extends an express app if it was not created with express-compose
Kind: static method of expressComposer
Param | Type | Description |
---|---|---|
app | function |
express app |
Example
var express = expressComposer = app = ;expressComposer;
function
expressComposer.handle(handlers, scopeProvider) ⇒ Creates an express middle ware handler that will iterate through composers handlers
Kind: static method of expressComposer
Param | Type | Description |
---|---|---|
handlers | Array.<function()> | function |
|
scopeProvider | ScopeProvider |
the scope of these handlers |
function
expressComposer.error(handlers, scopeProvider) ⇒ Creates an express middle ware error handler that will iterate through composers error handlers
Kind: static method of expressComposer
Param | Type | Description |
---|---|---|
handlers | Array.<function()> | function |
|
scopeProvider | ScopeProvider |
the scope for these handlers |
function
expressComposer.validate(validate, scopeProvider) ⇒ Create an express middle ware that validates an incoming request
Kind: static method of expressComposer
Param | Type | Description |
---|---|---|
validate | function |
validation function |
scopeProvider | ScopeProvider |
scope variable |
Object
| function
| Promise.<Object>
expressComposer~scopeArg : Kind: inner typedef of expressComposer
function
| Array.<function()>
expressComposer~requestHandlers : Kind: inner typedef of expressComposer
String
expressComposer~pathArg : Kind: inner typedef of expressComposer
Object
expressComposer~appOptions : Express application options passed into express
Kind: inner typedef of expressComposer
Properties
Name | Type | Description |
---|---|---|
dotFiles | String |
Option for serving dotfiles. Possible values are �allow�, �deny�, and �ignore� |
etag | Boolean |
Enable or disable etag generation |
extentions | Boolean |
Sets file extension fallbacks. |
index | Object | String |
Sends directory index file. Set false to disable directory indexing. |
lastModified | Boolean |
Set the Last-Modified header to the last modified date of the file on the OS. Possible values are true or false. |
maxAge | Boolean |
Set the max-age property of the Cache-Control header in milliseconds or a string in ms format |
redirect | Number |
Redirect to trailing �/� when the pathname is a directory. |
setHeaders | function |
Function for setting HTTP headers to serve with the file. |
Object
expressComposer~routerOptions : Options passed into express [Router]{http://expressjs.com/api.html#router}
Kind: inner typedef of expressComposer
Properties
Name | Type | Description |
---|---|---|
caseSensitive | Boolean |
Enable case sensitivity. |
mergeParams | Boolean |
Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child�s value take precedence. |
strict | Boolean |
Enable strict routing. |
object
expressComposer~requestMethod : Kind: inner typedef of expressComposer
Properties
Name | Type | Description |
---|---|---|
validator | function |
function used to validate the request |
preHandlers | requestHandlers |
handlers that will be called during execution of the route |
scope | scopeArg |
scope values to inject into the context of the handlers |
errorHandlers | requestHandlers |
handlers called if there is an error during the request |
name | String |
name of the method |
description | String |
description about what this method does |
object
expressComposer~requestMethods : Kind: inner typedef of expressComposer
Properties
Name | Type | Description |
---|---|---|
checkout | requestMethod | requestHandlers |
handles checkout requests |
connect | requestMethod | requestHandlers |
handles connect requests |
copy | requestMethod | requestHandlers |
handles copy requests |
delete | requestMethod | requestHandlers |
handles delete requests |
get | requestMethod | requestHandlers |
handles get requests |
head | requestMethod | requestHandlers |
handles head requests |
lock | requestMethod | requestHandlers |
handles lock requests |
m-search | requestMethod | requestHandlers |
handles m-search requests |
merge | requestMethod | requestHandlers |
handles merge requests |
mkactivity | requestMethod | requestHandlers |
handles mkactivity requests |
mkcol | requestMethod | requestHandlers |
handles mkcol requests |
move | requestMethod | requestHandlers |
handles move requests |
notify | requestMethod | requestHandlers |
handles notify requests |
options | requestMethod | requestHandlers |
handles options requests |
patch | requestMethod | requestHandlers |
handles patch requests |
post | requestMethod | requestHandlers |
handles post requests |
propfind | requestMethod | requestHandlers |
handles propfind requests |
proppatch | requestMethod | requestHandlers |
handles proppatch requests |
purge | requestMethod | requestHandlers |
handles purge requests |
put | requestMethod | requestHandlers |
handles put requests |
report | requestMethod | requestHandlers |
handles report requests |
search | requestMethod | requestHandlers |
handles search requests |
subscribe | requestMethod | requestHandlers |
handles subscribe requests |
trace | requestMethod | requestHandlers |
handles trace requests |
unlock | requestMethod | requestHandlers |
handles unlock requests |
unsubscribe | requestMethod | requestHandlers |
handles unsubscribe requests |
Object
expressComposer~routeScore : Kind: inner typedef of expressComposer
Properties
Name | Type | Description |
---|---|---|
methods | requestMethods |
methods for this route |
preHandlers | requestHandlers |
handlers that are executed before a route method |
errorHandlers | requestHandlers |
handlers for errors within this route |
scope | scopeArg |
scope argument for this route |
name | String |
the name of the route |
description | String |
a description of the route |
path | pathArg |
the path for the route |
Object
expressComposer~routerScore : Kind: inner typedef of expressComposer
Properties
Name | Type | Description |
---|---|---|
preHandlers | requestHandlers |
handlers that are executed during this route |
routes | routeScore | Array.<routeScore> |
routes for this router |
errorHandlers | requestHandlers |
handles errors tha occurred in this route |
scope | scopeArg |
scope options to include in this scope |
routers | routerScore |
nested routers |
name | String |
name of this route |
description | String |
a description of this route |
path | pathArg |
the path to this route |
routerOptions |
options for the router |
Object
expressComposer~appScore : Kind: inner typedef of expressComposer
Properties
Name | Type | Description |
---|---|---|
preHandlers | requestHandlers |
handlers that are executed for this app |
errorHandlers | requestHandlers |
handles errors tha occurred in this route |
scope | scopeArg |
scope options to include in this scope |
routers | routerScore | Array.<routerScore> |
nested routers |
name | String |
name of this route |
description | String |
a description of this route |
appOptions |
options for the router | |
appScore | Array.<appScore> |
apps for this app | |
path | pathArg |
the path for the app |
vhost | String |
a vhost routing string |
properties | Object |
an object used to set express options |