stubby4node icon indicating copy to clipboard operation
stubby4node copied to clipboard

Support for handling all live requests?

Open tgabre opened this issue 5 years ago • 2 comments

I'm using a single yaml file and Stubby to handle all live requests to an api. Is there any support for Stubby to use a single file to dynamically handle all live requests, as such?

-  request:
      url: ^/.+
      method: [GET, POST]
   response:
      status: 302
      headers: 
         Location: https://liveEndpoint.com<% url[0] %>

As of right now, all requests going through Stubby are GETs despite the client app sending out GETs and POSTs.

tgabre avatar Jan 07 '20 19:01 tgabre

You should be able to use a wildcard url; it is just a regex match.

mrak avatar Jan 21 '20 22:01 mrak

I have no problems with the urls, the regex match just fine. My problem is the request methods don't act dynamically. I list out GET and POST in the method field. My client will send GETs, which Stubby intercepts and acts in an expected manner. The client will subsequently send a POST, only for Stubby to intercept and send a GET.

tgabre avatar Jan 24 '20 14:01 tgabre