mulesoft / osprey

Generate Node.JS API middleware from a RAML definition
Other
431 stars 66 forks source link

Add proxy support for baseUri #67

Closed jewelsjacobs closed 9 years ago

jewelsjacobs commented 9 years ago

See details here: https://github.com/mulesoft-labs/osprey-mock-service/issues/2

blakeembrey commented 9 years ago

Hey! I'm going to keep this issue open on the mock service, but I don't think this belongs in Osprey. It's not really an API design pattern that should be promoted. If you have two major API versions, they'll usually be kept separate and routed to via a proxy like nginx. However, mocking-wise, it makes perfect sense to properly reflect the full URL. If you have an API you're trying to do this in already, you can mount the server within Express (or connect, etc) using app.use('/api/v2', osprey.createServer(raml)) and mount the API to the same route. That same RAML definition won't be applicable to both APIs.