This demo is similar to https://kenanhancer.com/2018/01/18/javascript-pipeline-example-with-es6/
The difference between demo of previous post and this post is the object passed to the pipeline is builded by a request that client made. So that every http request will have its own middlewares pipeline.
https://gist.github.com/kenanhancer/ba63562d3171fe3fa4aa021df2663c3e