How to use the @loopback/service-proxy.getService function in @loopback/service-proxy

To help you get started, we’ve selected a few @loopback/service-proxy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github strongloop / loopback4-example-shopping / packages / shopping / src / services / recommender-grpc.service.ts View on Github external
async value(): Promise {
    const grpcService = await getService(this.dataSource);
    const service: RecommenderService = {
      getProductRecommendations: async (userId: string) => {
        const res = await grpcService.recommend({userId});
        return res.products;
      },
    };
    return service;
  }
}

@loopback/service-proxy

A common set of interfaces for interacting with service oriented backends such as REST APIs, SOAP Web Services, and gRPC microservices

MIT
Latest version published 11 days ago

Package Health Score

89 / 100
Full package analysis

Similar packages