# api-gateway **Repository Path**: dddmt/api-gateway ## Basic Information - **Project Name**: api-gateway - **Description**: 基于apisix插件化开发 - **Primary Language**: Lua - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2021-03-29 - **Last Updated**: 2021-11-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README api-gateway: 基于apisix的网关。 主要是了解openresty开发和apisix的插件化开发。 ## 项目结构 ``` api-gateway │ ├─conf │ └─config.yaml // apisix 的配置文件 │ ├─docker │ └─prepare-init.d // apisix所需依赖的安装脚本文件夹 │ └─entrypoint.sh // Dockerfile容器构建好的初始化脚本 │ │ ├─etcd_data // etcd 数据 │ │ ├─logs // apisix 日志目录 │ └─third │ └─apisix │ │ └─plugin //apisix 自研插件安装包 │ └─deps // lualocks 依赖 ``` docker-compose.yml > 可以自己定制apisix的docker环境(包含openresty、lua及luarocks),如下 ```properties services: apisix: build: context: ./docker dockerfile: Dockerfile ``` > 也可以直接从docker hub拉取构建好的apisix镜像 ```properties services: apisix: image: xshower/apisix:centos8 ``` conf/config.yaml ```properties etcd: host: # it's possible to define multiple etcd hosts addresses of the same etcd cluster. - "http://主机IP:2379" # multiple etcd address ``` ## 依赖 第三方依赖安装放在docker/prepare-init.d目录下。如果需要**重新安装依赖, 请清空.init_cache内容** ## 插件 自研插件请放在third/plugins目录下,如果需要添加插件目录请修改patch.sh脚本。 ## 启动 在docker-compose.yml文件目录下执行 ```shell docker-compose up -d ```