Запустите код nodeJS в плагине Redmine

Как я могу запустить код nodeJS в плагине Redmine? С сервером nodeJS или с контроллера или чего-то еще ...?

Мой плагин представляет собой HTML-кнопку в хуке, вызывающую функцию javascript onClick. Когда я нажимаю эту кнопку, я хочу запустить код nodeJs. Как я могу сделать ?

Я использую Redmine 1.4.4.

РЕДАКТИРОВАТЬ: может быть, это может мне помочь? https://github.com/cowboyd/rednode


person EloHailwidis    schedule 26.03.2014    source источник


Ответы (1)


Я нашел решение здесь: 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.
person EloHailwidis    schedule 31.03.2014