定制 qandidate/toggle-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

qandidate/toggle-api

Composer 安装命令:

composer require qandidate/toggle-api

包简介

Api interface for your toggles.

README 文档

README

An API for managing your toggles, uses Redis to store the toggle collection.

build status

About

Read our blog post series about this repository at:

Installation

Install the dependencies with composer:

make dependencies

Configuration is determined based on environment variables. See the .env.* files. You can override the values in the file with environment values. The default configuration is mainly for local development.

The environment variable TOGGLE__ALLOWED_ORIGINS should be valid JSON. This is to allow arrays.

Running the tests

We use PHPUnit, so to run the tests simply run:

docker-compose up -d
make test

Running the app

With your favorite webserver (or with php -S 127.0.0.1:1337 -t public for local testing) point your document root to the public folder.

Endpoints

Retrieve the toggles

GET /toggles

Create or update a toggle

PUT /toggles/{name}

Example request:

{
   "conditions" : [
      {
         "name" : "operator-condition",
         "operator" : {
            "name" : "less-than",
            "value" : "1337"
         },
         "key" : "user_id"
      }
   ],
   "name" : "foo",
   "status" : "conditionally-active",
   "originalName" : "foo"
}

NOTE: PUT doesn't remove the previous toggle if you rename it. So if you want to rename foo to bar, you would have to PUT bar and DELETE foo.

Delete a toggle

DELETE /toggles/{name}

License

MIT, see LICENSE.

统计信息

  • 总下载量: 164
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 31
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 31
  • Watchers: 6
  • Forks: 9
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-08-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固