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.

Get Front-End Web Development: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.