Alonski / realworld-ember

This repository is deprecated. Please visit:
https://github.com/gothinkster/ember-realworld-example-app
5 stars 0 forks source link

Configure Ember Data to talk to the hosted API #4

Closed alexlafroscia closed 7 years ago

alexlafroscia commented 7 years ago

Because the API seems like a pretty standard REST-ful API, Ember Data should be a good fit for us, rather than making on-off requests through AJAX directly.

We'll need to configure an Ember Data serializer to make that work.

More info here: https://github.com/gothinkster/realworld-starter-kit/blob/master/FRONTEND_INSTRUCTIONS.md#using-the-hosted-api

Alonski commented 7 years ago

We should setup an application adapter and serializer. We need to use RESTSerializer and not JSON. I started working on article model

alexlafroscia commented 7 years ago

Cool. My PR sets up the RESTAdapter and the serializer can be left out. I had to get hat set up for the User model

alexlafroscia commented 7 years ago

This should be taken care of in this commit:

https://github.com/Alonski/realworld-ember/commit/e0ee968021b0f9a775693db76382b6bc30211e11

The API is pretty standard as far as REST APIs go, and the default REST adapter is working for the User model. It should work for the other models too without needing to special-case the adapter for each model.