Skip to content

Instantly share code, notes, and snippets.

@phlcastro
Last active June 15, 2016 23:53
Show Gist options
  • Save phlcastro/aba16edd37d8c80d6f8e00e6bc716d08 to your computer and use it in GitHub Desktop.
Save phlcastro/aba16edd37d8c80d6f8e00e6bc716d08 to your computer and use it in GitHub Desktop.
export default function() {
// These comments are here to help you get started. Feel free to delete them.
/*
Config (with defaults).
Note: these only affect routes defined *after* them!
*/
// this.urlPrefix = ''; // make this `http://localhost:8080`, for example, if your API is on a different server
this.namespace = 'v2'; // make this `api`, for example, if your API is namespaced
// this.timing = 400; // delay for each request, automatically set to 0 during testing
this.get('/me', function(schema, request){ console.log(schema.mes); return schema.mes.first(); });
/*
Shorthand cheatsheet:
this.get('/posts');
this.post('/posts');
this.get('/posts/:id');
this.put('/posts/:id'); // or this.patch
this.del('/posts/:id');
http://www.ember-cli-mirage.com/docs/v0.2.0-beta.7/shorthands/
*/
}
export default [
{id: 1, firstName: 'paulo', lastName: 'castro'}
];
import { Model } from 'ember-cli-mirage';
export default Model.extend({
});
export default function(server) {
/*
Seed your development database using your factories.
This data will not be loaded in your tests.
Make sure to define a factory for each model you want to create.
*/
// server.createList('post', 10);
server.loadFixtures();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment