[英]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.