mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-01-12 04:23:04 +02:00
update krakend
This commit is contained in:
parent
f77d0a5990
commit
a0b3cca085
@ -7,4 +7,54 @@ Its core functionality is to create an API that acts as an aggregator of many
|
|||||||
microservices into single endpoints, doing the heavy-lifting automatically for
|
microservices into single endpoints, doing the heavy-lifting automatically for
|
||||||
you: aggregate, transform, filter, decode, throttle, auth and more.
|
you: aggregate, transform, filter, decode, throttle, auth and more.
|
||||||
|
|
||||||
|
|
||||||
|
## krakend.json
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"version": 2,
|
||||||
|
"name": "My httpbin gateway",
|
||||||
|
"port": 8080,
|
||||||
|
"endpoints": [
|
||||||
|
{
|
||||||
|
"endpoint": "/httpbin",
|
||||||
|
"backend": [
|
||||||
|
{
|
||||||
|
"host": [
|
||||||
|
"https://httpbin.org"
|
||||||
|
],
|
||||||
|
"url_pattern": "/headers"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"host": [
|
||||||
|
"https://httpbin.org"
|
||||||
|
],
|
||||||
|
"url_pattern": "/ip"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## up and running
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ docker-compose up -d
|
||||||
|
$ curl http://localhost:8080/httpbin
|
||||||
|
```
|
||||||
|
|
||||||
|
## result.json
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"headers": {
|
||||||
|
"Accept-Encoding": "gzip",
|
||||||
|
"Host": "httpbin.org",
|
||||||
|
"User-Agent": "KrakenD Version 1.0.0"
|
||||||
|
},
|
||||||
|
"origin": "172.17.0.1, 1.2.3.4, 172.17.0.1"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
[1]: https://www.krakend.io/
|
[1]: https://www.krakend.io/
|
||||||
|
Loading…
Reference in New Issue
Block a user