Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dteam-top/dgate
an API Gateway based on Vert.x
https://github.com/dteam-top/dgate
api-gateway groovy java mock
Last synced: 3 months ago
JSON representation
an API Gateway based on Vert.x
- Host: GitHub
- URL: https://github.com/dteam-top/dgate
- Owner: DTeam-Top
- License: apache-2.0
- Archived: true
- Created: 2016-11-12T08:43:47.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-12-09T13:24:49.000Z (about 3 years ago)
- Last Synced: 2024-09-24T21:53:16.098Z (3 months ago)
- Topics: api-gateway, groovy, java, mock
- Language: Groovy
- Homepage:
- Size: 217 KB
- Stars: 226
- Watchers: 34
- Forks: 63
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dgate:an API Gateway based on Vert.x
![badge](https://github.com/DTeam-Top/dgate/workflows/CI/badge.svg)
dgate是基于Vertx的API Gateway。运行dgate的命令如下:
~~~
java -jar dgate-version-fat.jar -Dconf=conf
~~~其中,conf中定义了路由规则,下面是一个简单的例子:
~~~
apiGateway {
port = 7000
host = 'localhost'
urls {
"/url1" {
required = ['param1', 'param2']
methods = ['GET', 'POST']
upstreamURLs = [
[host: 'localhost', port: 8080, url: '/test']
]
}
"/url2" {
required = ['param1', 'param2']
methods = ['GET', 'POST']
upstreamURLs = [
[host: 'localhost', port: 8080, url: '/test1'],
[host: 'localhost', port: 8080, url: '/test2']
]
}
}
}
~~~dgate的主要特性:
- 轻量级配置,无需后端DB
- DSL为groovy语法
- 支持mock:HTTP和EventBusBridge
- 支持url的转发和组合(即一个外部url对应后端多个url),并支持before(向后端发送请求前)和after(收到后端全部响应后)闭包。
- 支持request透传:form和upload用这种模式。
- 支持URL Path Parameters
- 支持JWT
- 支持CORS
- 灵活的login配置(此时,在启动时需要先设置环境变量,请参见手册)
- 支持断路器
- 灵活的请求缓存策略
- 支持集群详细的用户指南请访问[这里](./docs/user_guide.md)。
## 开发指南
- git clone
- ./gradlew shadowJar,生成dgate的fatjar
- ./gradlew test,运行测试代码在发起Pull Request时,请同时提交测试代码,并保证现有测试代码【对于测试,我们推荐[Spock](http://spockframework.org/)】能全部通过,;)。