Skip to content

Instantly share code, notes, and snippets.

View cah-brian-gantzler's full-sized avatar

brian.gantzler cah-brian-gantzler

  • Cardinalhealth
  • Columbus Ohio
View GitHub Profile
Ember-cli-mirage in an Embroider world
Way out of my depth here. Will keep this up to date as I learn more.
What does ember-cli-mirage provide? (now that MirageJS has extracted the core of code)
1. Allows you to define your models, adapters, fixtures, etc as seperate files via blueprints. It discovers those files and provides them to the make-server in a hash that MirageJS expects
2. Provides a method to discover all the ED models and create the mirageJS definitions needed for the mirageJS createServer. Also now provides same for serializers.
3. Provides a method to start the server in dev mode`startMirage` and a method to start the server in tests `setupMirage`
4. Provides a way to include the mirage files in dev mode (auto start the server)or production or only for tests
@cah-brian-gantzler
cah-brian-gantzler / adapters.album.js
Last active April 9, 2019 16:10 — forked from BenjaminBeck/adapters.album.js
demo ember-models-table async filter/sort
import DS from "ember-data";
export default DS.RESTAdapter.extend({
//namespace: 'api',
host: 'https://jsonplaceholder.typicode.com',
//coalesceFindRequests: true
handleResponse: function handleResponse(status, headers, payload, requestData) {
let result = this._super(...arguments);
result = {album: result}
return result;