Kellrkind
Kellrkind

Reputation: 11

Call graph from javascript file and return boolean value

We want to define a graph via flowhub which should

In the first step we want to call the graph with a button on our homepage. Normally it's started via javascript but we don't know how we should call the graph. Is there an url with port which forwards the request to our graph and gets the response as answer which we can handle or how does this kind of noflo process work?

Upvotes: 0

Views: 101

Answers (1)

bergie
bergie

Reputation: 930

So, for this there are couple of ways to go, depending how your setup looks like.

If your graph requires NoFlo on Node.js, then you could either:

  • Wrap it in another NoFlo graph that provides a web API to your graph. If you want to go the RESTful route, then noflo-xpress is a good option. noflo-websocket provides a nice way to do this with a WebSocket connection instead
  • Wrap it in a regular Node.js web app (for example, Express) via noflo.asCallback

If your graph doesn't require server-side functionality, the other option is:

  • Build a browser-executable bundle of your NoFlo graph with grunt-noflo-browser, then include that in your web app and use noflo.asCallback

Upvotes: 1

Related Questions