0

I am trying to start to use NoFlo in my existing microservice architecture and I want to start out with a HTTP server so that I can mount it on my proxy and play/test with it.

You can find the repository here.

I am using Docker (Compose) to manage some services (with Dockerfile and start-docker.sh), but they also all have local startup scripts (start-local.sh). Both the scripts run NPM scripts to start the servers with their injected ENV vars.

I have some questions:

  1. Should the starting point of the application be the server.js file, or a .fbp Graph?
  2. What do I put in my package.json to start the server?
  3. When I have started all the Docker containers with Docker Compose and the NoFlo Server is running, will I be able to program a HTTP server using Flowhub.io?
Industrial
  • 2,861
  • 2
  • 15
  • 10

1 Answers1

0

Whether you want to run your process with a custom Node.js script (and embed NoFlo inside), or whether you run NoFlo as the top-level control flow doesn't really matter that much.

For the former case, build and run your Docker image just like you would any other Node.js one.

For the latter case, you may want to execute the graph via noflo-nodejs. If you want to make the graph live programmable from the outside (with for instance Flowhub), you should also expose the FBP protocol port.

You can find a simple example of running a NoFlo graph via Docker here: https://github.com/flowhub/bigiot-bridge/blob/master/Dockerfile

For easier switching between running in Docker, vs. running locally, one great option is to place the noflo-nodejs command to be the start script in package.json.

bergie
  • 930
  • 7
  • 8