Created
May 26, 2021 18:28
-
-
Save sergueyarellano/37b9623040b74affb93fa6d9a27fafac 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
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