Refactor NodeJS arch

have a look at the architecture used here:
https://github.com/dpb587/kibana-metrics/blob/master/lib/proxy.js