This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |