jimpex
    Preparing search index...

    Variable httpServicesProviderConst

    httpServicesProvider: {
        apiClientProvider: ResourceCreator<
            "provider",
            "register",
            (options?: APIClientProviderOptions) => (app: Jimpex) => void,
            ProviderRegisterFn<Jimpex>,
        >;
        httpProvider: Resource<"provider", "register", ProviderRegisterFn<Jimpex>>;
        responsesBuilderProvider: Resource<
            "provider",
            "register",
            ProviderRegisterFn<Jimpex>,
        >;
    } & Record<
        string,
        Resource<"provider", "register", ProviderRegisterFn<Jimpex>>,
    > & { provider: true } & { register: ProviderRegisterFn<Jimpex> } & Record<
        string,
        unknown,
    > = ...

    Registers all the HTTP services on the container.

    Type Declaration

    • apiClientProvider: ResourceCreator<
          "provider",
          "register",
          (options?: APIClientProviderOptions) => (app: Jimpex) => void,
          ProviderRegisterFn<Jimpex>,
      >

      The provider creator to register an instance of APIClient on the container.

        // Register it on the container
      container.register(apiClientProvider);
      // Getting access to the service instance
      const apiClient = container.get<APIClient>('apiClient');
        container.register(
      apiClientProvider({
      serviceName: 'myApiClient',
      configSetting: 'myApi',
      }),
      );
    • httpProvider: Resource<"provider", "register", ProviderRegisterFn<Jimpex>>

      The service provider that once registered on the container will set an instance of HTTP as the http service. The provider also checks the debug.logRequests setting on the application configuration in order to enable or not the logging of requests/responses.

      // Register it on the container
      container.register(httpProvider);
      // Getting access to the service instance
      const http = container.get<HTTP>('http');
    • responsesBuilderProvider: Resource<"provider", "register", ProviderRegisterFn<Jimpex>>

      The service provider that once registered on the container will set an instance of ResponsesBuilder as the responsesBuilder service.

      // Register it on the container
      container.register(responsesBuilderProvider);
      // Getting access to the service instance
      const responsesBuilder = container.get<ResponsesBuilder>('responsesBuilder');
    • provider: true
    • register: ProviderRegisterFn<Jimpex>
    // Register the collection on the container
    container.register(httpServicesProvider);
    // Getting access to one the services instance
    const apiClient = container.get<APIClient>('apiClient');