Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/binocarlos/multi-http-demo
A small pair of node.js http services speaking over some kind of network - for demos
https://github.com/binocarlos/multi-http-demo
Last synced: 11 days ago
JSON representation
A small pair of node.js http services speaking over some kind of network - for demos
- Host: GitHub
- URL: https://github.com/binocarlos/multi-http-demo
- Owner: binocarlos
- Created: 2015-03-13T12:04:18.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-03-13T12:14:39.000Z (over 9 years ago)
- Last Synced: 2024-04-14T14:36:44.783Z (7 months ago)
- Language: JavaScript
- Size: 203 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# multi-http-demo
A small pair of node.js servers to demonstrate a multi-process stack deployment.
## usage
There are Dockerfiles in each folder to build each service.
There is an `api` and a `server` - they are arranged as follows:
```
HTTP Client|
server
|
api
```The api writes a file to disk and increments an integer saved to the file on each request.
The server connects to the API to fetch the number.
## why?
Because I wanted 2 services communicating over a network to fulfill a front-end HTTP request.
The simpler the services the better because the point is to show how to deploy the services and setup SDN networking between them.
## Docker
The 2 services are automated builds on the Docker Hub as the following:
* binocarlos/multi-http-demo-server
* binocarlos/multi-http-demo-apiAn example of running the 2 using docker - we assume the IP of the host is 192.168.8.120
#### server
```bash
$ docker run -d
-p 8080:80 \
-e API_IP=192.168.8.120 \
-e API_PORT=8081 \
binocarlos/multi-http-demo-server
```#### api
```bash
$ docker run -d
-p 8081:80 \
-e DATA_FILE=/tmp/db.txt \
-v /tmp/db.txt:/tmp/db.txt \
binocarlos/multi-http-demo-api
```## Licence
MIT