Chapter 8. Building an Ember Backend
Ember and Ember Data are entirely client-side JavaScript, so it is possible for them to interface with any backend. In fact, that is one of the most compelling aspects of Ember Data.
There are many useful examples on the Web of developers using anything from .NET MVC, Django, Sinatra, PHP, Grails, and many others to deliver JSON to their Ember application. Here are a few:
- @toranb has an example RESTAdapter for Django.
- Microsoft provides a template for building Ember apps with .NET.
- The team at Travis uses Sinatra.
- Ember Data is so flexible that you can also use other protocols, such as WebSocket, to push/pull data from remote data stores.
- One great example is the work by the team at Firebase. They created a custom adapter for working with their hosted WebSocket backend.
All of this is made possible by Ember Data Adapters. By writing a custom adapter, an application can connect to any backend and any protocol accessible through a web browser.
In this chapter, we will look at building a few backends using some of today’s most common web app frameworks like Express.js and Ruby on Rails. We will introduce a few new solutions to address moving our backend from local storage to a remote database. We will also address having a “server-centric” web framework to deliver our single page.
RESTful Web Service APIs
In Chapter 7, we introduced Ember Data and the LocalStorageAdapter. Now, let’s begin to explore one of the core adapters provided by default, ...
Get Building Web Apps with Ember.js now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.