jasonswett / angular-for-rails-developers-issues

Issues found in Angular for Rails Developers book
https://www.angularonrails.com/angular-rails-developers/
5 stars 1 forks source link

Getting Started with Angular and Rails: API resource URL /api/books.json omits //host:port #10

Closed matthewlmcclure closed 8 years ago

matthewlmcclure commented 8 years ago

The free Getting Started with Angular and Rails, in the section named Step 2: Add an HTTP request to Angular, contains the following code:

    this.http.get('/api/books.json')

I believe it should be:

    this.http.get('//localhost:3000/api/books.json')
jasonswett commented 8 years ago

@matthewlmcclure Thanks for the suggestion, although I actually want to keep the front end ignorant of localhost:3000. The main reason is that the production URL will be different. In development, I like to proxy all /api requests to localhost:3000 in a development-only config file.