user1431072
user1431072

Reputation: 1442

In IIS, can I use the same base path for multiple Web API applications?

Is there any way to have multiple, independent iis websites that all use the same URL base path?

I have a Web API application that contains http webservices grouped by domain (order, product, shipping, etc...). I want to break those domains into individual API applications so that I can deploy them individually. The only problem is that I don't know how I'd deploy these to iis without having a different url path for each API application.

For example, currently (since every web service is in a single WEB API application), if i want to use the order API, i simply use

 http://localhost/api/order/{order-id}

If i were to break apart the application into smaller web applications (1 per domain), is there any way i can continue to use

http://localhost/api 

as my base path? Or will I have to use something like:

http://localhost/OrderApi/order/{order-id}

Upvotes: 3

Views: 5097

Answers (1)

mythz
mythz

Reputation: 143339

Reverse Proxying / Url Rewriting to different ServiceStack instances

An elegant option is to separate them into distinct Services and conceptually have them appear under the same url structure by using a reverse proxy or rewrite rules in IIS which will let you have different top-level paths mapped to different independent ServiceStack instances, e.g:

Upvotes: 3

Related Questions