Middleware to serve buffers, strings or files