简体   繁体   中英

Can I deploy two ASP.NET (MVC and WebApi) applications side-by-side?

I am working on an ASP.NET project. We have two main projects, and MVC website, and a WebApi2 application that it uses to interface with the datebase. All of the routes of the WebApi2 application are something like "/api/Entity" I would like it so that our main MVC site that users are actually hitting will be hosted in the domain root (ie. www.example.com), while being able to access the api at "www.example.com/api/Entity". Is there a way to do that without doing a bunch of IIS configuration, or changing my routes?

  1. You can place them in the same project.
  2. You can create an application within IIS called api and change the route definition in the api project to remove the /api/ . Doesn't seem like a bunch of configuration/changing routes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM