Skip to content

Instantly share code, notes, and snippets.

@sergueyarellano
Created May 28, 2021 17:08
Show Gist options
  • Save sergueyarellano/05af969234828482c3471c8850c79d48 to your computer and use it in GitHub Desktop.
Save sergueyarellano/05af969234828482c3471c8850c79d48 to your computer and use it in GitHub Desktop.
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