Members
-
<static, readonly> ABSOLUTE_PATH_MATCHER
-
Description
Absolute path win/*nixProperties
Name Type Description ABSOLUTE_PATH_MATCHER
Regexp Regular expression to match an absolute win/*nix path Examples
Mockettaro.ABSOLUTE_PATH_MATCHER
Details
Methods
-
<static> resourceConfigRoute( req, res, next )
-
Description
Configuration RouteParameters
Name Type Description req
Express.Request Request / previous route params res
Express.Response Response instance next
function Callback to be called to step forward in route chain Examples
const express = require('express');<br>const app = express();<br>...<br>app.use(Mockettaro.resourceConfigRoute);
Details
-
<static> returnResponse( req, res )
-
Description
Configuration RouteParameters
Name Type Description req
Express.Request Request / previous route params res
Express.Response Response instance Examples
const express = require('express');<br>const app = express();<br>...<br>app.use(Mockettaro.returnResponse);
Details
-
<static> errorHandler( err [, req ], res [, next ] )
-
Description
Error Handler RouteParameters
Name Type Attributes Description err
string | Error Raised error req
Express.Request <optional> Request / previous route params res
Express.Response Response instance next
function <optional> Callback to be called to step forward in route chain, needed for Express to manage it as an Error Handler Examples
const express = require('express');<br>const app = express();<br>...<br>app.use(Mockettaro.errorHandler);
Details