nl_tokens: PrivateFunction : createExpressJsRoute Creates an Express . JS request handlers .
pl_tokens: function createExpressJsRoute ( url , callbacks , expressJsMethod , app ) { debug ( 'creating express.js route for url `%s`' , <mask> ) ; var self = this , expressJsHandler = createExpressJsCallback ( function success ( apiResult , httpStatusCode ) { httpStatusCode = httpStatusCode || 200 ; this . res . send ( httpStatusCode , apiResult ) ; } , function error ( err ) { var message , stack , httpStatusCode = 500 ; if ( ! _ . isUndefined ( err ) ) { if ( _ . has ( err , 'httpStatusCode' ) ) { httpStatusCode = err . httpStatusCode ; } message = err . toString ( ) || err ; stack = err . stack || undefined ; } this . res . send ( httpStatusCode , message ) ; winston . log ( 'error' , 'API callback stopped with error' , { source : self . toString ( ) , apiRoute : url , err : message , stack : stack } ) ; } , callbacks , app ) ; expressJsMethod . call ( app , url , expressJsHandler ) ; }