Fast-gateway is an easy to use Node.js API gateway framework built to handle large scale API traffic with great performance and scalability. Written with JavaScript, it is a framework for the masses!
Imho it'd be better to use the original query string - over the parsed one - to make sure no change happens. Otherwise, an easy option to specify the serialization style would be a good alternative - maybe in addition for a serialization callback (enum | function).
The above mentioned line of code could be changed to require('url').parse(req.url, false).query or require('url').parse(req.url, true).search - depending on if the leading ? needs to be included or not.
When using a specific query parameter serialization style it might be this lib changes the serialization for the upstream request. https://github.com/BackendStack21/fast-gateway/blob/4a2ff7d02aedc3157413145040bc7fd115070660/index.js#L121
This actually stores the parsed query params to
queryString
rather than the original string. Then for'http'
proxy type'sfast-proxy-lite
uses it's default serialization, which is comma separated: https://github.com/BackendStack21/fast-proxy-lite/blob/eb9df39341a33591e2aee596d69e5aed8256561e/index.js#L141Imho it'd be better to use the original query string - over the parsed one - to make sure no change happens. Otherwise, an easy option to specify the serialization style would be a good alternative - maybe in addition for a serialization callback (enum | function).
The above mentioned line of code could be changed to
require('url').parse(req.url, false).query
orrequire('url').parse(req.url, true).search
- depending on if the leading?
needs to be included or not.