Created
May 28, 2021 17:08
-
-
Save sergueyarellano/05af969234828482c3471c8850c79d48 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
app.get('/stores', async (req, res) => { | |
const config = { | |
host: 'http://localhost:3010', | |
endpoint: 'data', | |
method: 'GET', | |
headers: { 'content-type': 'application/json' }, | |
contract: { | |
type: 'class', | |
description: 'report', | |
location: 'address', | |
distance: 'range' | |
} | |
} | |
const { result } = await pipe( | |
composeRequest, | |
makeRequest, | |
mapResponse, | |
createResult | |
)(lift(config)) | |
res.json(result) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment