Clone the repo and cd to queue
directory
yarn
yarn dev
variable | default | use |
---|---|---|
PORT | 3002 | port in which queue will listen for requests |
API_URI | localhost:3000 | api base url, should depend on the machine the queue is deployed |
API_QUEUE_SECRET | apiqueuesecret | secret key shared between api and queue |
REDIS_PORT | 6379 | redis database port |
REDIS_HOST | localhost | redis database host |
REDIS_PASS | redis database pass | |
ARQUITRAN_URI | http://arqss16.ing.puc.cl | arquitran api url |
ARQUITRAN_TOKEN | d51f6a66-e670-41c4-8187-2149bc46654e | arquitran api token |
ARQUITRAN_ID | G1 | arquitan api group id |
-
Route:
POST
/purchase
-
Headers:
- Content-Type:
application/json
- Secret:
env_variable_API_QUEUE_SECRET
- Content-Type:
-
Example Body:
{ "orders": [ { "userId": "aUserId", "productId": "aProductId", "sentAt": "dateOfPurchase" }, ] }
-
Success Response:
-
Status: 200
-
Content:
{ "message": "Created N tasks" }
-
-
Error Response (untested):
-
Code: 500
-
Content:
{ "message": "Error description" }
-
Code: 401
-
Content:
{ "message": "Unauthorized" }
-