a2-in-memory-web-api icon indicating copy to clipboard operation
a2-in-memory-web-api copied to clipboard

complex resource paths

Open johnpapa opened this issue 8 years ago • 2 comments

support for

 `/api/customer/32/orders`
 `/api/customer/32/orders/451`
 `/api/customer/address`

johnpapa avatar Jan 19 '16 18:01 johnpapa

We take PRs ;-)

I agree it would be nice. Do you have the use case now?

wardbell avatar Jan 19 '16 21:01 wardbell

I'd like the solution to be support almost any request url scheme.

My instinct is to add a configurable route/response map where the response is a function with access to the in-mem datastore, original request, parsed request, and response-building helper functions.

We'll need a route recognizer for request url pattern matching and parsing of parameters.

The current route handling would become the initial, default state of this map.

wardbell avatar Jan 20 '16 20:01 wardbell