backend-app-api: move healthchecks to healthService

Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
Vincenzo Scamporlino
2024-05-17 15:17:26 +02:00
parent 53ced701dd
commit 8d4735767d
11 changed files with 206 additions and 7 deletions
@@ -0,0 +1,20 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @public
*/
export interface HealthService {}
@@ -26,11 +26,6 @@ export interface HttpRouterServiceAuthPolicy {
allow: 'unauthenticated' | 'user-cookie';
}
/** @public */
export interface HttpRouterHealthCheckConfig {
handler: () => Promise<any>;
}
/**
* Allows plugins to register HTTP routes.
*
@@ -102,6 +102,13 @@ export namespace coreServices {
import('./DiscoveryService').DiscoveryService
>({ id: 'core.discovery' });
/**
* The service reference for the plugin scoped {@link RootHealthService}.
*/
export const health = createServiceRef<
import('./RootHealthService').RootHealthService
>({ id: 'core.health', scope: 'root' });
/**
* Authentication of HTTP requests.
*
@@ -32,10 +32,10 @@ export type {
export type { RootConfigService } from './RootConfigService';
export type { DatabaseService } from './DatabaseService';
export type { DiscoveryService } from './DiscoveryService';
export type { HealthService } from './HealthService';
export type {
HttpRouterService,
HttpRouterServiceAuthPolicy,
HttpRouterHealthCheckConfig,
} from './HttpRouterService';
export type { HttpAuthService } from './HttpAuthService';
export type {