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!
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