Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oieduardorabelo/hexchange
Example of API using three upstream services to aggregate data. One of them uses a webhook callback to return its results.
https://github.com/oieduardorabelo/hexchange
Last synced: 10 days ago
JSON representation
Example of API using three upstream services to aggregate data. One of them uses a webhook callback to return its results.
- Host: GitHub
- URL: https://github.com/oieduardorabelo/hexchange
- Owner: oieduardorabelo
- Created: 2022-07-17T08:46:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-17T11:15:38.000Z (over 2 years ago)
- Last Synced: 2024-04-14T19:10:11.544Z (7 months ago)
- Language: JavaScript
- Size: 47.9 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Hexchange API 💵 💵 💵
Example of API using three upstream services to aggregate data. One of them uses a webhook callback to return its results.
Based on [Francisco Zanfranceschi](https://twitter.com/zanfranceschi) tweet challenge.
### Challenge:
- Aggregate data from three [upstream](https://medium.com/code-factory-berlin/up-down-stream-what-is-it-a4b4792f5d0b) APIs into one API.
- Upstream Service C uses a webhook callback to return its results.### Diagram:
![API with external dependency on 3 APIs. One of them uses webhooks to return the response.](./docs//challenge-diagram.jpg)
### Getting Started:
**Requirements:**
- Node.js 16.x or above
- Docker 20.x or above
- pnpm 7.x or npm 7.xFrancisco shared a Docker Hub image with all three services.
Open your terminal and in one window execute:
```bash
docker run --rm -p 8080:80 zanfranceschi/desafio-01-cotacoes
```Open another terminal window and execute:
```bash
git clone [email protected]:oieduardorabelo/hexchange.git
cd hexchange
pnpm install # or npm install
pnpm dev # or npm run dev
```With the environment ready, you can start querying the Hexchange API
```bash
curl http://localhost:4000/cotacoes/usd
curl http://localhost:4000/cotacoes/eur
```