ruyadorno/snapstub

Request: optional config file

traverse opened this issue ยท 2 comments

Hello @ruyadorno,

First off thanks for the awesome tool!

As the title states it would be awesome if we were able to use an optional config file. In my case for example we have a ton of endpoints and need to include a bunch of custom headers. Having to either type out the commands manually or writing a script for it might not be ideal for everyone so might I suggest the use of a config file or something similar. The structure for it could be quite simple, the following for example:

{
  "headers": {
    "name": "value"
  },
  "methods": ["get", "put"],
  "endpoints": [
    "some/api/endpoint"
  ]
}

It might even be nice to have the option to create multiple of these objects as you might not want to test the same methods for each endpoint.

If you have any reasons why this is a bad idea please share them so we might be able to come up with a good alternative.

Hi @traverse, you might wan to read the stubborn-server's documentation which is the core stub util listed in the dependencies.

Stubborn-server's config files would allow a flexible behaviour such as the one described. Snapstub uses the configuration driven approach described in that README but doesn't prevent using a custom approach as well.

Thanks a lot @zeachco that would work just fine for me. ๐Ÿ‘ ๐Ÿ‘