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();