Created
May 26, 2021 18:32
-
-
Save sergueyarellano/b96994f909c3c1e16a7748d79e91b7e9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function composeRequest (payload) { | |
const config = payload.data.config | |
const endpoint = config.endpoint | |
const base = config.host | |
const headers = config.headers | |
const method = config.method | |
const requestOptions = { | |
uri: new URL(endpoint, base), | |
options: { | |
headers, | |
method | |
} | |
} | |
payload.data.request = requestOptions | |
return payload | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment