4
votes

I'm writing an ember application that pulls the majority of it's data from the Lastfm API. The API is not RESTful. I'm not sure what what level of abstraction I should customize. Should I go down the path of writing a custom LastFm ember-data adapter? Or should I just sidestep ember-data all together?

They return data similar to this:

{ "recenttracks" : { "meta" : {}, "tracks" : [ { track info }, { track info } ] } }

For requesting data, they have a scheme that involves sending a method parameter. So, not the worst thing ever, but certainly not RESTful.

Anyway, just looking for a bit of direction as I'm new to ember-data.

Thanks!

1

1 Answers

3
votes

Personally, I would create a new adapter, not necessarily RESTAdapter, passing parameters to find and findAll:

var lastFmAdapter = DS.Adapter.create({
  find: function (store, type, id) { },
  findAll: function (store, type) { }
});