Skip to content

joshnuss/angular-rails-api

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

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. joshnuss@gmail.com

About

A template for creating angular+rails apps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages