Hi there. I’ve been struggling some time now trying to get my ember-app running together with my rails-api on the same server.
I believe that I have found the right (perhaps too simplistic) solution. Since I am very proud of myself, I thought that I would share it on this forum, in case some other poor soul can be helped.
Capistrano is my tool of choice when deploying my rails app to
/home/deploy/rails-api, and for the ember-app I just do this:
$ sudo su - deploy $ git clone firstname.lastname@example.org:kgish/ember-app.git $ cd ember-app $ npm install $ bower install $ ember build --environment=production
Here’s what my apache config file looks like and it seems to do the trick.
Listen 8080 <VirtualHost *:80> DocumentRoot /home/deploy/ember-app/dist/ <Directory /home/deploy/ember-app/dist> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> ProxyPass /api/v1 http://localhost:8080/api/v1 </VirtualHost> <VirtualHost *:8080> DocumentRoot /home/deploy/rails-api/current/public/ <Directory /home/deploy/rails-api/current/public> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> </VirtualHost>
If anyone else has a better idea and/or believes that this is not really a very elegant solution, I would sure like to know.