Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hyacinthus/caddy-api-gateway-demo
Use caddy as API gateway in microservice.
https://github.com/hyacinthus/caddy-api-gateway-demo
Last synced: 18 days ago
JSON representation
Use caddy as API gateway in microservice.
- Host: GitHub
- URL: https://github.com/hyacinthus/caddy-api-gateway-demo
- Owner: hyacinthus
- License: mit
- Created: 2017-02-28T01:34:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-03-17T08:26:03.000Z (over 7 years ago)
- Last Synced: 2024-08-01T00:43:13.770Z (3 months ago)
- Language: Go
- Size: 9.77 KB
- Stars: 27
- Watchers: 6
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Caddy API gateway demo
Use caddy as microservice API gateway in docker swarm.[![Build Status](https://semaphoreci.com/api/v1/muninn/caddy-api-gateway-demo/branches/master/shields_badge.svg)](https://semaphoreci.com/muninn/caddy-api-gateway-demo)
## Requirements
* Docker Engine 1.13+
* docker-compose 1.11.2+## Notice
The image in docker-compose is build by Dockerfile.app and Dockerfile.gateway in this demo.
I've host it in docker hub, so you can use it in next step directly.
You can also build the image by yourself, then don't forget to change the image name in docker-compose.yml## Run Server
Pull images from docker hub(~30M):
```bash
docker-compose pull
```
Run
```bash
docker stack deploy -c docker-compose.yml caddy
```## Try
Because of caddy's proxy connection reuse feature, you can't test this demo by
visit http://{your-host-ip}:2015 in your browser.
I write a client to send concurrent requests.
If you have docker,
```bash
docker run --rm -it muninn/caddy-microservice:client
```
You can also use unix shell version:
```bash
cd client
sh test.sh
```
app will tell you which container it is running in.