Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF Web Api as a subdomain of an asp.net mvc 3 app?

I have an mvc app running on mydomain.com, and I have added a wcf web api to the web project.

I can access the rest service by going to mydomain.com/MyResource but I actually want MyResource to ONLY work if I go to api.myDomain.com/MyResource, and mydomain.com/MyResource to look for a controller called MyResourceController and throw an error if it didn't find it.

How can I do this?

like image 779
nacho10f Avatar asked Nov 05 '22 12:11

nacho10f


1 Answers

You'll have to create a new web site in IIS to solve this and create two projects in your solution.

like image 63
Alexander Zeitler Avatar answered Nov 15 '22 05:11

Alexander Zeitler