0

I have nodejs api:

export const applyitem = (req,res)=>{
    const { id } = req.params;
   
    const applyitems = JSON.parse(JSON.stringify(itemData)); 

    const founditem = applyitems.find((item) => item.itemId == id);
    res.send(founditem); 
}

I have a c# program making use of "Restsharp" nuget package to get data from node js:

 using RestSharp;
 public class Program
    {
        static void Main(string[] args)
        {
            string url = "http://localhost:5000/applyitem";
            var aclient = new RestClient(url);
            var arequest = new RestRequest();
            var response = aclient.Get(arequest);

            Console.WriteLine(response.Content.ToString());
            Console.ReadKey();
        }
    }

Currently applyitem gets called from my angular code. I want nodejs to fire an event like whenever applyitem is called from angular to nodejs , c# should get notified and the latest item should be sent to c# code. How to achieve this?

Mr.Curious
  • 282
  • 1
  • 3
  • 11
  • 1
    For a C# backend, you could use SignalR; in Node.JS implementing a WebSocket server might be an option. Also, you could use a Queue/ServiceBus to connect server and C# client. – Markus Sep 21 '22 at 07:03

0 Answers0