Open petrosp opened 7 years ago
Same problem here, every tutorials advice to create a rails --api app but there's nothing about it in the description of this gem.
The idea behind the --api
switch is too create a rails app that only serves an API (presumably JSON) and not render any HTML.
http://edgeguides.rubyonrails.org/api_app.html
It doesn't really make sense to use this Gem if you are using rails api, in that case you would deploy and serve your ember application HTML separately.
The answer to your question is Yes, and can be easily done on Heroku. I am not familiar with Mina though.
Main advantages for me of having the API and the Ember front-end together:
Main advantages for me of having the API and the Ember front-end together:
One repo Can do integrated testing of ember and rails through the UI e.g. rspec and spinach
That's all fine, but why use the --api switch then?
because, aside from the Ember app, you have other consumers of your API.
Which operating system and version is the project developed on? macOS El Capitan - 10.11.6
Which version of
ruby
is the project developed on? 2.3.3Which version of
npm
is the project developed on? 3.10.10Which version of
ember-cli
is the project developed on? 2.10What is the
rails
version? 5.0.0.1 (API version)What is the
ember-cli-rails
version (fromGemfile
)? 0.8.3What is the
ember-cli-rails-addon
version (frompackage.json
)? 0.8.0Is your application server multi-threaded (such as
puma
andunicorn
) or is it multi-process (such as thin and webrick)? pumaWhat are the contents of
config/initializers/ember.rb
?What are the contents of the Rails' view that renders the Ember application? Have no views
How are the EmberCLI-related routes defined?
mount_ember_app :frontend, to: '/'
How is the application deployed? I am using
mina
to deploy the Rails appSo my issue is this:
I generated the app using the
--api
switch, thus there are nosprockets
. The deployment of therails
app is fine but theember
app - which compiles during theasset pipeline
compilation - fails as expected, since theRails
assets do not exist as this is anAPI
app.Is there an alternative way to compile
ember
's assets for thisrails
app, without haveingasset pipeline
involved during the deployment process?I did compiled them on the server independently, i.e. logged in and run
ember:compile
which do create the ember assets under the#{Rails.root}/tmp/ember-cli/apps/frontend
but I am not quite sure where to put those, is it under #{Rails.root}/public`?