Gold Challenge: Mirage

Ember CLI Mirage is a great addition to your development arsenal. It allows you to develop your application’s API needs before the back-end team finishes their stack.

Install ember-cli-mirage from your terminal to start using it:

ember install ember-cli-mirage

Next, to turn Mirage on and off, add an environment variable to config/environment.js:

if (environment === 'development') {
  // ENV.APP.LOG_RESOLVER = true;
  // ENV.APP.LOG_ACTIVE_GENERATION = true;
  // ENV.APP.LOG_TRANSITIONS = true;
  // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
  // ENV.APP.LOG_VIEW_LOOKUPS = true;
  ENV['ember-cli-mirage'] = {
    enabled: true
  }
}

Finally, add fake data in the form of factories for your witness and cryptid endpoints.

To work with your Tracker app, you can retrieve a configured app/mirage directory from the supplied example assets in Tracker/Data_Chapter/mirage-example. We will keep the example up to date for current releases of the addon.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.136.17.12