vocento/microservice-bundle
最新稳定版本:v5.3.1
Composer 安装命令:
composer require vocento/microservice-bundle
包简介
Base bundle for Microservice projects
关键字:
README 文档
README
This bundle contains the base for the services at Vocento and how the versioning and other resources of the service should work.
Installation
To install the bundle, include the package as a requirement in your composer.json file.
composer require vocento/microservice-bundle
Once the bundle is installed, you have to configure it.
Configure the Bundle
Add the bundle to the config/bundles.php file.
<?php return [ // ... Vocento\MicroserviceBundle\MicroserviceBundle::class => ['all' => true], ];
Add the bundle configuration to config/packages/microservice.yaml file
microservice: name: 'microservice-name' debug: '%kernel.debug%' manage_exceptions: true versions: list: - 'v1' - 'v2' - 'v3.1' - 'v3.1.4' current: 'v2'
Add the bundle routing configuration to config/routes/microservice.yaml file
microservice: resource: "@MicroserviceBundle/Resources/config/routing/base.yml"
This configuration will expose three endpoints related with the service in order to enable a way to auto-discover the service, the available versions and the current version.
Service endpoints
Request GET /service
{
"name": "microservice-name",
"current": "v2",
"versions": [
"v1",
"v2",
"v3.1",
"v3.1.4"
]
}
Request GET /service/name.json
{
"name": "microservice-name"
}
Request
GET /service/versions.json
{
"current": "v2",
"versions": [
"v1",
"v2",
"v3.1",
"v3.1.4"
]
}
Request GET /service/versions/current.json
{
"version": "v2"
}
统计信息
- 总下载量: 40.27k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2016-10-21