From 8f5ee839a76c9a0cc43e3745c1e9c8fff9ac8514 Mon Sep 17 00:00:00 2001 From: Patrick Barroso <103224477+patrickpbarroso@users.noreply.github.com> Date: Wed, 18 Jan 2023 19:37:22 -0300 Subject: [PATCH] Update index.js --- services/inventory/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/inventory/index.js b/services/inventory/index.js index 2eeabc9d..0190d49b 100644 --- a/services/inventory/index.js +++ b/services/inventory/index.js @@ -22,6 +22,13 @@ server.addService(inventoryProto.InventoryService.service, { }, }); +SearchProductByID: (payload, callback) => { + callback( + null, + products.find((product) => product.id == payload.request.id) + ); + }, + server.bindAsync('127.0.0.1:3002', grpc.ServerCredentials.createInsecure(), () => { console.log('Inventory Service running at http://127.0.0.1:3002'); server.start();