1

I have a web client working against a Node.js app. Now I need to update and integrate an existing C# into this scenario.

My C# generates a JSON object and I need to consume it in the Node.js app.

What's the simplest way do achieve this?

Joezer
  • 795
  • 1
  • 8
  • 20
  • node.js app is a server? – paradox Mar 19 '19 at 10:30
  • 1
    You have several options. Communicate via a REST API or some other protocol like RTP, web sockets, etc. – Alex Mar 19 '19 at 10:30
  • I'd venture that this question is too open-ended. You need to provide details about your existing setup ("web client working against a Node.js app") because it may be as simple as adding a handler to the node app (whatever that is) and posting data to it. On the other hand, if the app needs to authenticate so that others can't send junk to the same endpoint, you're dealing with a much nastier bag'o'worms. More detail please. – spender Mar 19 '19 at 10:46
  • @paradox - yes. (at)Alex - I am aware that there are many options, I wanted a simple code sample that does it. – Joezer Mar 19 '19 at 10:52
  • @spender - this one is fortunately in a closed network, and security is not consideration at this point. I just need the simple example as I'm a newby in node. My missing part is just moving the json from C# to a node listener – Joezer Mar 19 '19 at 10:55
  • @Joezer So look my answer and read Mikeal's request. That's what you want. – Mikev Mar 19 '19 at 10:55

1 Answers1

2

You can do it in many options, and you have a lot of examples in stackoverflow and in google.

Like @Alex said, you can do it via REST API, protocol like RTP, web sockets (for me this is the easiest way).

You have a lot of examples and module's like for example:

Examples:

Mikev
  • 1,844
  • 1
  • 11
  • 22