rst
rst

Reputation: 2714

Deploy multiple projects to same IIS web site

I have a complete solution with multiple projects (repository, services, helpers, etc.) and in particular one executable project WebAPI and another called Web. Ideally I would like to deploy everything to the same IIS website but having the WebAPI using

www.mysite.com/api/routes

and the regular Web (which is a SPA using the API)

www.mysite.com/home

So both projects have seperate controllers but should be on the same website (but one in a subfolder).

I just don't really know how to setup the IIS. I was trying to create multiple website, but that doesn't work, since I can't set a subfolder (/api). Virtual Directories don't work, since I cannot deploy seperately onto a virtual directory. Any advice?

Upvotes: 1

Views: 2049

Answers (1)

MisterSmith
MisterSmith

Reputation: 3624

I disagree with this statement:

Virtual Directories don't work, since I cannot deploy seperately onto a virtual directory.

When creating a virtual directory you create a path in the main website which points to a webroot. That webroot can (and should be) outside the main websites webroot. This means you can deploy either the SPA or API independently by targeting the aapropriate webroot.

Upvotes: 2

Related Questions