gstroup / apimocker

node.js module to run a simple http server for mock service responses.
MIT License
280 stars 81 forks source link

POST parameters (switch?) available for template feature? #49

Closed ferrerod closed 8 years ago

ferrerod commented 8 years ago

I would like to use the values of parameters in a JSON POST body and substitute them into a JSON template file that I will return as a response to this request. Is this possible? How would I accomplish this? Do I need to use a smart JSON-Path based switch statement to identify the parameters and then use the template naming convention within the response .json file? The current simplistic template example shows the templated parameters in the GET request query string, while I would like to use the my POST parameters.

ferrerod commented 8 years ago

I will create a pull request shortly with support for the above. It enables a whole new dynamic for templates!