1 Star 0 Fork 0

hzwy23 / gateway

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
README.md 922 Bytes
一键复制 编辑 原始数据 按行查看 历史
hzwy23 提交于 2020-05-12 23:41 . update

API 网关

Go SDK > 1.11

获取代码并运行(go mod 管理项目)

git clone https://github.com/hzwy23/gateway.git
cd gateway
go mod tidy
go run main.go

配置介绍

server:
    port: 8790
    contextPath: /
    timeout: 10
    host:
registerCenter:
    refreshFrequency: 30
    eureka:
        serviceUrls: [ http://localhost:8761 ]
router:
    gateway:
        ignoredPatterns: [ /gateway, /js, /css ]
        sensitiveHeaders: [Cookie]
        routers:
            user:
                path: /map/**
                serviceId: map
                stripPrefix: true
                timeout: 30
            ai:
                path: /gitchat/**
                url: https://gitbook.cn
                stripPrefix: false
                timeout: 5

测试地址:

 http://localhost:8790/gitchat/columns/category/5d8b7c3786194a1921979123?page=1
Go
1
https://gitee.com/hzwy23/gateway.git
git@gitee.com:hzwy23/gateway.git
hzwy23
gateway
gateway
master

搜索帮助