This is the source from this channel 9 demo.
Install Nodejs, GraphicsMagick, and MongoDB.
> git clone https://github.com/aheckmann/channel9.git
> cd channel9
> npm i
MongoDB must already be running. Specify your connection string by set the CHANNEL9_MONGO
environment variable. If not set, the application will attempt to connect to the test database on localhost:27017.
> node server.js
// passing your own connection string
> CHANNEL9_MONGO=mongodb://localhost:99999 node server.js
Demonstrate the power of nodejs streams and their compatibility with both child_processes and MongoDB by streaming uploads through an express application, directly into GridFS for storage, and back out of MongoDB, through a graphicsmagick child_process with custom command line flags set, and finally piped back to an http response. This demo app was run on an Ubuntu vm created and running on Microsoft Azure.
in
------
clients file system -> nodejs (express) application -> pipe -> gridfs
out
------
gridfs -> pipe -> graphicsmagick -> pipe -> http response