GithubHelp home page GithubHelp logo

dgate's Introduction

dgate:an API Gateway based on Vert.x

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配置(此时,在启动时需要先设置环境变量,请参见手册)
  • 支持断路器
  • 灵活的请求缓存策略
  • 支持集群

详细的用户指南请访问这里

开发指南

  • git clone
  • gradle shadowJar,生成dgate的fatjar
  • gradle test,运行测试代码

在发起Pull Request时,请同时提交测试代码,并保证现有测试代码【对于测试,我们推荐Spock】能全部通过,;)。

dgate's People

Contributors

foxgem avatar abcfy2 avatar

Watchers

Yanxin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.