Express routes in jobs cannot update widget
Issue #127
resolved
I want to have a route added on the init of a job, if it gets called then have the dashboard update the widget.
having the ability to call jobCallback in the init function would solve this, I saw something alluding to it but cannot find anything to support this.
Comments (4)
-
-
Did you find a solution ? I would also like to update a widget with an express route.
-
Problem fixed. Just use the pushUpdate() method to update the widget.
var jobWorker = this; dependencies.app.route('jobs/mycustomroute').get(function(req, res) { jobWorker.pushUpdate({title: "my title", text: "some text"}) });
-
- changed status to resolved
- Log in to comment
Hi, same issue for me. did you find a solution?
i tried that: onInit: function (config, dependencies, job_callback) { dependencies.logger.info('adding routes...'); dependencies.app.route("/jobs/mycustomroute") .get(function (req, res) {
},