gstroup / apimocker

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

Provide support for optional basepath in URL #67

Closed kurtkanaskie closed 8 years ago

kurtkanaskie commented 8 years ago

I would like to be able to specify a "basepath" which is basically a prefix on webservices.

That helps me to use apimocker locally and in my Apigee API proxy, which specifies its own "basepath".

GET http://localhost:4000/basepath/customers

Then I can just change the value of basepath to "" when I deploy into Apigee GET http://api-gateway:9000/basepath/customers

This can be done with express pretty straightforward.

apiMocker.express.use(options.basePath,apiMocker.router);

gstroup commented 8 years ago

Sounds like a reasonable change. I'll try to add that in soon. Also, pull requests are welcome! If you make PR, please include a test or two.

gstroup commented 8 years ago

Fixed in v0.4.16.

kurtkanaskie commented 8 years ago

Works like a charm!

Thanks

On Fri, Oct 14, 2016 at 3:04 PM, Greg Stroup notifications@github.com wrote:

Fixed in v0.4.16.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gstroup/apimocker/issues/67#issuecomment-253893155, or mute the thread https://github.com/notifications/unsubscribe-auth/APfVqsSqbEQIoXaj75msGWbbU_t7gPTsks5qz9I2gaJpZM4KLVeX .