简体   繁体   English

如何在服务器的控制台中访问我的nodeJS应用程序?

[英]How can I access to my nodeJS app in console on my server?

I have an application nodeJS started like a deamon with forever( https://github.com/nodejitsu/forever ). 我有一个应用程序nodeJS像恶魔一样永远启动( https://github.com/nodejitsu/forever )。

So now, how can I access to my app and be abble to watch and change values of variables with SSH connexion on my server? 因此,现在,我该如何访问我的应用程序,并想通过服务器上的SSH连接监视和更改变量的值?

How open console on my app without interuption of service? 如何在不中断服务的情况下在我的应用程序上打开控制台?

thx. 谢谢。

您应该看一下节点检查器

There's nothing built-in for that. 没有内置的功能。

However, you can create a function on the server that will eval whatever string you put as parameter. 但是,您可以在服务器上创建一个函数,该函数将评估您放置为参数的任何字符串。

To query that function, you can use ajax or socket.io for example. 要查询该功能,可以使用例如ajax或socket.io。

Socket.io example Socket.io示例

    socket.on('evalStr', function (str) { eval(str);}); //server
    socket.emit('evalStr', "myVar = 10;"); //client via console

Edit: Of course, you can add security such as testing a password before evaluating. 编辑:当然,您可以在评估之前增加安全性,例如测试密码。

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

相关问题 如何使用服务器域名从本地计算机访问我的nodejs Web服务器? - How can I access my nodejs web server from my local computer using the server domain name? 如何将错误记录到txt文件和nodejs的控制台中? - How can I log my errors into a txt file AND the console in nodejs? 我可以用来访问Expess应用程序(nodejs)的URL是什么 - What is the url with which I can access my expess app (nodejs) 如何在我的应用程序中为特定路径禁用NodeJS Express,并允许其中之一访问特定的正则表达式? - How can I disable NodeJS Express for specific paths in my app and allow access to a specific regex in one of them? 有什么方法可以访问Linux服务器上的nodejs控制台吗? - Is there any way to access my nodejs console on linux server? 如何使前端应用程序访问节点服务器api - How can I make my front end app access my node server apis 如何将实时重新加载添加到我的 nodejs 服务器 - How can I add live-reload to my nodejs server 如何从我的 nodejs 服务器中删除文件 - How can i delete a file from my nodejs server 如何让我的 NodeJS 应用程序在服务器上运行? - How can I get my NodeJS application working on a server? 如何在我现有的 nodejs 服务器上使用 sqs 消息 - How can i consume sqs messages at my existing nodejs server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM