micromata / http-fake-backend

Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
MIT License
311 stars 22 forks source link

Response function instead of static data #21

Open zlanich opened 5 years ago

zlanich commented 5 years ago

Looking at Hapi.js, it looks like you can supply a function as a handler so you can take incoming path params, etc and supply a dynamic response. Why does this not seem possible with http-fake-backend? It seems like this would be like 1 line of code in supportedMethod.js to make this work.

Example usage: https://hapijs.com/api#path-parameters

mischah commented 5 years ago

Good idea 👌🏼 Are you interested in making a PR?

zlanich commented 5 years ago

As soon as I get a small but of free time, I could do that.