Last active
June 15, 2016 23:53
-
-
Save phlcastro/aba16edd37d8c80d6f8e00e6bc716d08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ | |
*/ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default [ | |
{id: 1, firstName: 'paulo', lastName: 'castro'} | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Model } from 'ember-cli-mirage'; | |
export default Model.extend({ | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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