Search code examples
asp.net-mvcwcfwcf-web-apiappharbor

Can I run an MVC app and WCF Web Api on the same AppHarbor site?


We have a solution with this structure.

  • OurApp.Web (mvc 3 project with controllers, views)
  • OurApp.Api (mvc 3 project with wcf web api service classes)
  • OurApp.Domain (entities, repositories, unit of work, etc)
  • OurApp.Tests (tests)

We want to use a dns structured like this:

http://www.ourapp.com points to OurApp.Web

http://api.ourapp.com points to OurApp.Api

We want to host on AppHarbor.

How can we do this?


Solution

  • AppHarbor currently only supports deploying one application from any given repository. One option might be to fold the API into the web project. I did this for a non-web API WCF service here.

    Another option is to maintain two AppHarbor applications, and use solution files named according to what application you want deployed for that application. That is, OurApp.Web.sln contains the Web project and any supporting projects and, OurApp.Api.sln references the API project and any supporting projects. Read more about AppHarbor solution file convention.

    (disclaimer, I'm co-founder of AppHarbor)