Communicating between Node.Js and ASP.NET MVC Application

前端 未结 2 1442
心在旅途
心在旅途 2021-01-12 06:36

I have an existing complex website built using ASP.NET MVC, including a database backend, data layer, as well as the Web UI layer. Rebuilding this website in another languag

2条回答
  •  庸人自扰
    2021-01-12 07:19

    I'm not an ASP.NET expert, but I think there are multiple ways you can achieve this:

    1) As you said, you could make Node listen on a specific port for data and then react based on the data received (TCP)
    2) You can make POST requests to Node.js (HTTP) and also send an auth-key in the process to be extra-secure. Like on 1) Node would react to the data you send.
    3) Use something like Redis for pub-sub, send messages from ASP.NET (pub) and get them on the Node.js part (sub). This is even better if you want to scale your app across multiple machines etc.

提交回复
热议问题