只是按照documentation但每次我导航或调用网址时,它都会返回404给我
// app/mirage/config.js
export default function() {
this.get('/api/users', function() {
return {
users: [
{id: 1, name: 'Zelda'},
{id: 2, name: 'Link'},
{id: 3, name: 'Epona'},
]
}
});
}
Uncaught UnrecognizedURLError:/ api / users
谢谢你的帮助 .
1 回答
在浏览器中直接导航到该URL将不会遵循海市蜃楼管道 . 相反,当您的ember应用程序查询您已配置的 endpoints 时,海市蜃楼将发送模拟数据 . 因此,您需要实现一些能够从您的Ember应用程序调用您的 endpoints 的东西 .