darklynx / request-baskets

HTTP requests collector to test webhooks, notifications, REST clients and more ...
https://rbaskets.in
MIT License
339 stars 52 forks source link

[Feature] Support create basket and configure response #86

Open celosauro opened 1 year ago

celosauro commented 1 year ago

We can provision a basket with BASKET param, but the response config is only in interface/api. To docker containers make senses configure automatically responses to a provisioned basket.

Something like:

request-baskets -basket myapi -response ./response-config.json
darklynx commented 1 year ago

This make sense, I'll think of it.

Maybe even something like this:

request-baskets -baskets ./initial-baskets.json

where initial-baskets.json can look like:

{
  "basket1": {
    "responses": {
      "GET": {
        "status": 302,
        "headers": {
          "Location": "./basket2"
        }
      }
    }
  },
  "basket2": {
    "config": {
      "forward_url": "https://my-other.service/collector",
      "proxy_response": true,
      "capacity": 500
    }
  },
  "index.html": {
    "config": {
      "capacity": 500
    },
    "responses": {
      "GET": {
        "status": 200,
        "headers": {
          "Content-Type": "application/html"
        },
        "body": "<html><body><h1>Welcome to Request Baskets</h1></body></html>"
      }
    }
  }
  ...
}