Skip to content
This repository was archived by the owner on Jun 6, 2018. It is now read-only.

offirgolan/ember-data-mirage

Repository files navigation

⚠️ DEPRECATED ⚠️

This addon is no longer being developed since it has been merged with Ember CLI Mirage in v0.3.2.

Ember Data Mirage

ember-cli-mirage Build Status npm version

Automatically create Mirage models based on the app's Ember Data models

Features

  • Automatically create mirage models based off of your ember data models
  • Models will include the appropriate relationships and associations
  • Easily build on top of the pre created models

Installation

ember install ember-data-mirage

Helpful Links

Looking for help?

If it is a bug please open an issue on GitHub.

Usage

Register the Models

In your mirage/config.js add the following two line to the top:

import { registerModels } from 'ember-data-mirage';

export default function() {
  // Register Models
  registerModels(this);

  // Everything else goes here
  this.urlPrefix = '';    // make this `http://localhost:8080`, for example, if your API is on a different server
  this.namespace = '/api';    // make this `/api`, for example, if your API is namespaced
  this.timing = 300;      // delay for each request, automatically set to 0 during testing
}

Extending a Model

You can extend a pre created model via the following syntax

// mirage/models/foo.js

import { modelFor } from 'ember-data-mirage';

export default modelFor('foo').extend({
  bar: belongsTo('foo')
});

About

Automatically create Mirage models based Ember Data models

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy