gstroup / apimocker

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

Add proxy option #38

Closed ztsmith closed 8 years ago

ztsmith commented 8 years ago

This adds a basic proxying capability, leveraging express-http-proxy. This is integrated using a catch all express route.

Resolves https://github.com/gstroup/apimocker/issues/35

I had to add some 404 handling in the functional test proxy to make a test pass. I played around with putting the proxy tests in a separate file, but decided it was better to have the test proxy enabled for all functional tests. That way we can have better confidence it won't break existing functionality.

I did some additional testing in a real use case where I needed the proxy function, and it worked well.

gstroup commented 8 years ago

Looks good! I'll try to get it merged in, and published to npm as soon as I can. Thanks a lot.

gstroup commented 8 years ago

published in npm v 0.4.8. Thanks!