Class: RouterFactory

vertx-web-api-contract-js/router_factory~ RouterFactory

new RouterFactory()

Main interface for Design Driven Router factory
Source:

Methods

addGlobalHandler(globalHandler) → {RouterFactory}

Add global handler to be applied prior to Router being generated.
Please note that you should not add a body handler inside that list. If you want to modify the body handler, please use RouterFactory#setBodyHandler
Parameters:
Name Type Description
globalHandler function
Source:
Returns:
this object
Type
RouterFactory

addSecurityHandler(securitySchemaName, handler) → {RouterFactory}

Mount to paths that have to follow a security schema a security handler
Parameters:
Name Type Description
securitySchemaName string
handler function
Source:
Returns:
Type
RouterFactory

getOptions() → {Object}

Get options of router factory. For more info RouterFactoryOptions
Source:
Returns:
Type
Object

getRouter() → {Router}

Construct a new router based on spec. It will fail if you are trying to mount a spec with security schemes without assigned handlers
Note: Router is constructed in this function, so it will be respected the path definition ordering.
Source:
Returns:
Type
Router

getValidationFailureHandler() → {function}

Source:
Returns:
Type
function

setBodyHandler(bodyHandler) → {RouterFactory}

Supply your own BodyHandler if you would like to control body limit, uploads directory and deletion of uploaded files
Parameters:
Name Type Description
bodyHandler BodyHandler
Source:
Returns:
self
Type
RouterFactory

setExtraOperationContextPayloadMapper(extraOperationContextPayloadMapper) → {RouterFactory}

When set, this function is called while creating the payload of OperationRequest
Parameters:
Name Type Description
extraOperationContextPayloadMapper function
Source:
Returns:
Type
RouterFactory

setNotImplementedFailureHandler(notImplementedFailureHandler) → {RouterFactory}

Set not implemented failure handler. It's called when you don't define an handler for a specific operation. You can enable/disable this feature from RouterFactoryOptions
Parameters:
Name Type Description
notImplementedFailureHandler function
Source:
Returns:
this object
Type
RouterFactory

setOptions(options) → {RouterFactory}

Set options of router factory. For more info RouterFactoryOptions
Parameters:
Name Type Description
options Object
Source:
Returns:
Type
RouterFactory

setValidationFailureHandler(validationFailureHandler) → {RouterFactory}

Set default validation failure handler. You can enable/disable this feature from RouterFactoryOptions
Parameters:
Name Type Description
validationFailureHandler function
Source:
Returns:
this object
Type
RouterFactory