async-response-aggregator-server
A lightweight server to aggregate response from async requests
Install
$ git clone https://github.com/yoanm/async-response-aggregator-server.git
$ cd async-response-aggregator-server
$ yarn install
Usage
Server
# Switch to right node version
$ nvm use
# Start server
$ NODE_ENV=prod npm start
Running at http://localhost:8000
Documentation
Swagger documentation is available at /documentation
Request options
Uri
Endpoint URI
- Required
- Type: String
- Allowed schemes:
http
,https
Method
Method to use
- Type: String
- Allowed Values:
GET
,POST
,PUT
,DELETE
,PATCH
- Default Value:
GET
Payload
Payload to send (for POST
request for instance)
- Type:
object
,array
,string
- Default value:
null
QueryString
Query string to send (for GET
request for instance)
- Type:
object
,array
,string
- Default value:
null
Headers
Header to use
- Type:
object
Json
Whether to parse response as JSON or not
- Type:
boolean
- Default value:
true
Body example
-
GET
request with query string (a=b&c[0]=1
) and custom headers ({"plop": true}
) :
{
"method": "GET",
"uri": "http://uri",
"headers": {
"plop": true
},
"queryString": "a=b&c[0]=1",
"json": false
}
-
POST
request with payload ({"property": "value"}
) (response will be parsed as json)
{
"method": "POST",
"uri": "http://uri",
"payload": {
"property": "value"
}
}
-
GET
request with query string (a=b&c[0]=1
) and custom headers ({"plop": true}
) :
{
"method": "GET",
"uri": "http://uri",
"headers": {
"plop": true
},
"queryString": {
"a": "b",
"c": [
1
]
},
"json": false
}
]