Answering my own question here:
The middleware to use is compile-middleware
. Works fine by default with connect
, but with express I had to modify it in order to not write headers (ugly i know, but time waits for no one) : https://github.com/airtonix/compile-middleware
implementation: https://gist.github.com/airtonix/9601224
Original Credit goes to (You should try using this one first): https://github.com/shinohane/compile-middleware