lucky icon indicating copy to clipboard operation
lucky copied to clipboard

Allow fallback to specify what methods it will catch

Open UnsolvedCypher opened this issue 4 years ago • 1 comments

Currently, fallback only catches GET requests, but I think it would be helpful to optionally specify an array of methods that it will catch. The use case would be to delegate certain requests to another server (for example, have Lucky catch POST requests to a certain subdirectory and make them to a third-party API or another server running locally).

UnsolvedCypher avatar May 19 '20 22:05 UnsolvedCypher

I think your idea of an array of methods is a great idea. The default can be get but overridable:

fallback(:get, :post, :put)

Thanks for the suggestion and feature request

paulcsmith avatar May 20 '20 14:05 paulcsmith