Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

ember-data-mirage

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-data-mirage

Automatically create Mirage models based Ember Data models

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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
  • Changelog

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')
});

Keywords

ember-addon

FAQs

Package last updated on 24 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts