Skip to content

Instantly share code, notes, and snippets.

@jamesarosen
jamesarosen / 01-intro.md
Last active May 24, 2018 08:44
Ember-CLI + Ember-Data + Custom API

I had some trouble getting Ember-CLI and Ember-Data working with my existing HTTP API. These are the things I had to do to get it working:

Use ActiveModelSerializer by default

My API returns underscored_keys, not camelizedKeys. It's not exactly the standard ActiveModel, but it's quite similar. I started by defining a default (application) serializer that's a simple subclass of DS.ActiveModelSerializer:

// app/serializers/application.js
import DS from "ember-data";