All Projects → joshnuss → angular-rails-api

joshnuss / angular-rails-api

Licence: other
A template for creating angular+rails apps

Programming Languages

ruby
36898 projects - #4 most used programming language

Rails API + Angular Template

Creates a rails-api backend with an angular frontend. The frontend code will be located in <your-rails-app>/frontend/.

Usage

rails-api new <your-app-name> \
  --skip-sprockets \
  --skip-test-unit \
  --template=https://github.com/joshnuss/angular-rails-api/raw/master/template.rb

Features

Requirements

Common Tasks

  • 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

Development Mode

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.

Deployment

Run grunt build which copies all files to /public. Only rails is needed in production. Rack::Static is configured to serve static files.

Links

  1. Working with Angular.js and Rails

Time for a coffee break?

@joshnuss is a freelance software consultant. [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].