Created
March 17, 2020 06:17
-
-
Save bpinedah/d0af01a8f85a4de3af26dcadc3c35f93 to your computer and use it in GitHub Desktop.
Routes article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description Resolve function to exit from pipeline | |
* @param signal Flag to continue or not on pipeline | |
* @returns {*} | |
* @private | |
*/ | |
const _res = signal => () => ({ | |
statusCode: 200, | |
headers: {}, | |
setHeader: function setHeader(header) { | |
this.headers = {...this.headers, ...header}; | |
}, | |
send: function send(data) { | |
signal.continue = false; | |
return Promise.resolve(resHandler(this.statusCode, data, this.headers)); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment