fix routing when middleware is not set
This commit is contained in:
parent
ae787ce05a
commit
e8fd484da4
1 changed files with 10 additions and 3 deletions
|
@ -1,5 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
Route::get(config('prometheus.metrics_route_path'), 'MetricsController@getMetrics')
|
$route = Route::get(
|
||||||
->middleware(config('prometheus.metrics_route_middleware'))
|
config('prometheus.metrics_route_path'),
|
||||||
->name('metrics');
|
\Superbalist\LaravelPrometheusExporter\MetricsController::class . '@getMetrics'
|
||||||
|
)->name('metrics'); /** @var \Illuminate\Routing\Route $route */
|
||||||
|
|
||||||
|
$middleware = config('prometheus.metrics_route_middleware');
|
||||||
|
|
||||||
|
if ($middleware) {
|
||||||
|
$route->middleware($middleware);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue