如何在Redmine插件中运行nodeJS代码? 使用nodeJS服务器或控制器或其他任何东西......?
我的插件是Hook中的HTML按钮,调用onClick javascript函数。 当我按下这个按钮时,我想运行nodeJs代码。我该怎么办?
我使用Redmine 1.4.4
编辑:也许这对我有帮助吗? https://github.com/cowboyd/rednode答案 0 :(得分:0)
我在这里找到了一个解决方案:http://www.redmine.org/boards/2/topics/41820?r=41882
From what I know, 3 scenarios:
You want to use a publicly exposed NodeJS service.
In that case just make an ajax call to your service (jQuery).
You want to use a non-public NodeJS service Run your NodeJS
service on localhost (listening to 127.0.0.1) and call it from the controller
of your plugin.
You want to use a task (executable).
Run a system("/my/path/executable #{param}") command from the controller
of your plugin.
I don't like solution number 3 because there is more possibilities of something
going wrong.