简体   繁体   English

灰烬之海幻影404

[英]Ember-Cli-Mirage 404

Just followed the documentation but every time I navigate or call to the url, it returns 404 for me 只是遵循文档,但是每次我导航或调用url时,它都会为我返回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 未捕获的UnrecognizedURLError:/ api / users

Thanks for your help. 谢谢你的帮助。

Navigating directly to that URL in your browser will not follow the mirage pipeline. 在浏览器中直接导航到该URL不会遵循幻影管道。 Rather, when your ember application would have queried the end points you have configured, mirage will send mocked data instead. 相反,当您的余烬应用程序将查询您已配置的端点时,海市rage楼将改为发送模拟数据。 Therefore you need to implement something that will call your endpoint from within your Ember app. 因此,您需要实现一些可 Ember应用程序中调用端点的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM