0

We want to define a graph via flowhub which should

  • receive a file (or maybe just two strings --> user & password) (Not sure which components to use for this part)
  • check if they are staged in our database (will be mocked, later the strings will be forwarded to the backend and the graph should get an answer if it's okay or not to proceed)
  • return the result as boolean so the homepage knows whether to log the user in or not

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?

Richard Telford
  • 9,558
  • 6
  • 38
  • 51
Kellrkind
  • 11
  • 1
  • 3

1 Answers1

1

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
bergie
  • 930
  • 7
  • 8
  • thx for the fast response. But i have still several questions. We've built the project on flowhub and our problem is, which port or adress should the web api listen to? We want to call the graph via javascript out of a polymer project running on a different server. Are we needing an IP and Port to call the web API directly or is an URL quite enough? (for example app.flowhub.io/kellrkind/testproject/GraphX123Y.... sounds too easy :D) We are absolutely new to noflo and javascript :-/ – Kellrkind May 23 '17 at 18:46
  • Also i've discovered your noflo-strings. Exactly that's what we were searching for but is there an existing component to compare two strings if they are absolut identical? – Kellrkind May 23 '17 at 18:48