How to deploy separate 2 apps with 1 shared module on Heroku

The application I want to run on Heroku consists of 3 items:

  • a HTML frontend (www.myapp.com)
  • a JSON API (api.myapp.com)
  • and a common utility class both share

Since I use different subdomains (and I can't merge the 2 frontends), I have to create 2 separate Heroku apps, so I also need 2 Procfiles. Right?

Now, how do I tell Heroku which Procfile to use? (assuming everything is in one repository)

PS: I'm using Scala, Play and sbt.

Thanks in advance!

Answers


If your HTML frontend is just static files then you should actually put it on a CDN instead of Heroku. If you really want to run both on Heroku then create a git branch for each app on Heroku and then push associated branch to the right git remote. If you have a git remote for the www app called "heroku-www" and a git branch called "www" then you can push it to the master branch on Heroku with:

git push heroku-www www:master

Need Your Help

SQL update query and 'subquery returned more than one value'

sql sql-server tsql sql-server-2008

I am using SQL Server 2008, R2. Have a master table (table A), and am trying to update it with values from a temp table (Table B).

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.