ember-cli-mirage: Unable to get Mirage to intercept calls
Ember CLI: v3.11 Mirage: v1.1.0
I’m setting up an app using mirage, following these steps found in the installation guide and the overview:
1.ember install ember-cli-mirage
2. Add to config.js:
export default function() {
this.get('/routines');
}
- Create an ember and an ember-mirage model for
routine
When making a call for all routines, in the ember Route, the model hook is used:
export default Route.extend({
model() {
return this.store.findAll('routine');
},
});
When I go to the route in my app, a call is made to get routines at /routines, which the mirage config is set up to listen to. However, I get this 404 error:
Error while processing route: scenarios.index Ember Data Request GET /routines returned a 404
Instead of mirage intercepting /routines, the app is hitting http://localhost:4200/routines, which doesn’t exist for obvious reasons. I’ve tried this a few times, starting over from scratch, but I continue to have this problem. I’ve confirmed that the mirage config is loading and I haven’t made any additional setup other than what is recommended.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17
I need to look into this bc I think others were having trouble with it. Sorry you ran into this!