filld/service-status

该包的最新版本(v1.0.1)没有可用的许可证信息。

对根路由`/`的简单状态响应。它返回应用名称、版本、环境和git sha。

v1.0.1 2018-11-09 00:22 UTC

This package is auto-updated.

Last update: 2024-09-09 14:11:18 UTC


README

一个简单的Lumen服务提供程序,为我们的API中的`/`路由提供一致响应。

它返回应用名称、版本、环境和git sha。

安装

composer require filld/service-status

然后,在`bootstrap/app.php`文件中注册服务提供程序

$app->register(Filld\ServiceStatus\ServiceStatusServiceProvider::class);

导航到您服务的根路由,您应该能看到

{
    "app": "Service Name",
    "release": "1.0.0",
    "environment": "production",
    "commit": "ec75e50"
}

故障排除

这要求您在`config/app.php`中有一个注册的配置文件,其中至少包含以下内容

return [
    'name' => "Service Name",
    'version' => "1.0.0",
];

并且,对于Lumen,您必须在注册服务提供程序之前在`bootstrap/app.php`中加载该配置

$app->configure('app');