简体   繁体   English

如何构建和部署在 Visual Studio 中创建的 Nodejs 控制台项目

[英]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.在 Visual Studio 中您可以创建 NodeJS 控制台应用程序,您可以在 Visual Studio 中运行和调试。

在此处输入图像描述

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): 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.当我在 Visual Studio 中构建项目时,bin 文件夹只有这个文件:Microsoft.NodejsTools.WebRole.dll,我不知道这个文件是做什么用的。

I works on my local, because I have nodejs runtime environment set up and all dependencies installed under npm.我在本地工作,因为我设置了 nodejs 运行时环境,并且在 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?现在我想将它部署在服务器上,使其在服务器上工作的一种方法是将所有项目文件复制到一个文件夹中并通过 npm 安装所有依赖项,如果我必须这样做,Visual Studio 的“构建”是为了什么?

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 we use pm2 to manage node js apps on windows Install pm2 as windows service, use pm2 pm2 start to start your app then you can call it in C# code through http or socket

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM