how to stream a response in nodejs using graphicmagick

I am having a really difficult time returning an image from nodejs using graphicmagic. The browser is hung on the stream.

I have referenced NodeJS gm resize and pipe to response but I still can't make it work.

gm = require('gm');

app.get('/text', function (req, res)
{
    gm(200, 400, "#ddff99f3")
    .drawText(10, 50, "from scratch")
    .stream('png', function (err, stdout, stderr) {
      stdout.pipe(res);
    });
});

Looks like you aren't setting the appropriate Content-type:

res.set('Content-Type', 'image/png'); // set the header here

Do this before the call to gm.drawText

so...uh, I just rebooted my machine and it magically worked.