Creates a rails-api backend with an angular frontend. The frontend code will be located in <your-rails-app>/frontend/
.
rails-api new <your-app-name> \
--skip-sprockets \
--skip-test-unit \
--template=https://github.com/joshnuss/angular-rails-api/raw/master/template.rb
- To build the frontend:
cd frontend && grunt build
- To run the frontend server:
cd frontend && grunt serve
- To run the rails server:
bin/rails server
- To run the rails specs:
bin/rake spec
- To run the angular specs:
cd frontend && grunt test
In dev mode, you need to run both the frontend node server grunt serve
and the rails server rails server
All requests are served from the frontend server, requests to /api
are proxied to rails.
Run grunt build
which copies all files to /public
. Only rails is needed in production. Rack::Static
is configured to serve static files.
@joshnuss is a freelance software consultant. joshnuss@gmail.com