Skip to content

Instantly share code, notes, and snippets.

@sergueyarellano
Created May 26, 2021 18:28
Show Gist options
  • Save sergueyarellano/37b9623040b74affb93fa6d9a27fafac to your computer and use it in GitHub Desktop.
Save sergueyarellano/37b9623040b74affb93fa6d9a27fafac to your computer and use it in GitHub Desktop.
const express = require('express')
const bodyParser = require('body-parser')
const {pipe} = require('./tools')
const app = express()
const port = process.env.PORT || 3000
app.use(bodyParser.json())
app.get('/stores', (req, res) => {
const responseBody = pipe(
composeRequest // sync method
makeRequest, // async method
composeResponse // sync method
)()
res.json(responseBody)
})
app.listen(port, () => console.log(`app magic happens on port ${port}`))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment