이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 11. Overriding Core Backend Service Configuration


The Red Hat Developer Hub (RHDH) backend platform consists of a number of core services that are well encapsulated. The RHDH backend installs these default core services statically during initialization.

Customize a core service by installing it as a BackendFeature by using the dynamic plugin functionality.

Procedure

  1. Configure Developer Hub to allow a core service override, by setting the corresponding core service ID environment variable to true in the Developer Hub app-config.yaml configuration file.

    Table 11.1. Environment variables and core service IDs
    VariableOverrides the related service

    ENABLE_CORE_AUTH_OVERRIDE

    core.auth

    ENABLE_CORE_CACHE_OVERRIDE

    core.cache

    ENABLE_CORE_ROOTCONFIG_OVERRIDE

    core.rootConfig

    ENABLE_CORE_DATABASE_OVERRIDE

    core.database

    ENABLE_CORE_DISCOVERY_OVERRIDE

    core.discovery

    ENABLE_CORE_HTTPAUTH_OVERRIDE

    core.httpAuth

    ENABLE_CORE_HTTPROUTER_OVERRIDE

    core.httpRouter

    ENABLE_CORE_LIFECYCLE_OVERRIDE

    core.lifecycle

    ENABLE_CORE_LOGGER_OVERRIDE

    core.logger

    ENABLE_CORE_PERMISSIONS_OVERRIDE

    core.permissions

    ENABLE_CORE_ROOTHEALTH_OVERRIDE

    core.rootHealth

    ENABLE_CORE_ROOTHTTPROUTER_OVERRIDE

    core.rootHttpRouter

    ENABLE_CORE_ROOTLIFECYCLE_OVERRIDE

    core.rootLifecycle

    ENABLE_CORE_SCHEDULER_OVERRIDE

    core.scheduler

    ENABLE_CORE_USERINFO_OVERRIDE

    core.userInfo

    ENABLE_CORE_URLREADER_OVERRIDE

    core.urlReader

    ENABLE_EVENTS_SERVICE_OVERRIDE

    events.service

  2. Install your custom core service as a BackendFeature as shown in the following example:

Example of a BackendFeature middleware function to handle incoming HTTP requests

// Create the BackendFeature
export const customRootHttpServerFactory: BackendFeature =
  rootHttpRouterServiceFactory({
    configure: ({ app, routes, middleware, logger }) => {
      logger.info(
        'Using custom root HttpRouterServiceFactory configure function',
      );
      app.use(middleware.helmet());
      app.use(middleware.cors());
      app.use(middleware.compression());
      app.use(middleware.logging());
      // Add a the custom middleware function before all
      // of the route handlers
      app.use(addTestHeaderMiddleware({ logger }));
      app.use(routes);
      app.use(middleware.notFound());
      app.use(middleware.error());
    },
  });

// Export the BackendFeature as the default entrypoint
export default customRootHttpServerFactory;
Copy to Clipboard

+ In the previous example, as the BackendFeature overrides the default implementation of the HTTP router service, you must set the ENABLE_CORE_ROOTHTTPROUTER_OVERRIDE environment variable to true so that the Developer Hub does not install the default implementation automatically.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat