'How to build and deploy a Nodejs console project created in Visual Studio

In Visual Studio you can create a NodeJS console application, you can run and debug in Visual Studio.

enter image description here

I want to deploy it on a window server, beside with IIS, my IIS web application can invoke it through Jering.Javascript.NodeJS from my c# code(Asp.net):

StaticNodeJSService.InvokeFromFileAsync<string>("nodejs\app.js", args: new string[] {})

When I build the project in Visual Studio, the bin folder only has this file: Microsoft.NodejsTools.WebRole.dll, I have no idea what this file is for.

It works on my local, because I have nodejs runtime environment set up and all dependencies installed under npm.

Now I want to deploy it on server, one way to make it work on server is to copy all the project files into a folder and install all the dependencies through npm, If I have to do so, what the visual studio 'build' for?



Solution 1:[1]

we use pm2 to manage node js apps on windows Install pm2 as windows service, use pm2 start to start your app then you can call it in C# code through http or socket

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1