如何让Mirage直通模块访问?

时间:2017-03-04 07:35:21

标签: ember.js ember-cli-mirage

我正在使用SimpleMDE,它似乎在内部向/node_modules/typo-js/dictionaries/en_US/en_US.dic发送请求。

enter image description here

enter image description here

如何使用Mirage传递此GET请求?

我使用以下设置但没有效果。

  this.passthrough('node_modules/**');
  this.passthrough('node_modules/typo-js/dictionaries/en_US/en_US.dic');

  this.passthrough('/node_modules/**');
  this.passthrough('/node_modules/typo-js/dictionaries/en_US/en_US.dic');

mirage配置文件中的代码,

export default function() {
  this.urlPrefix = 'http://localhost:3000';
  this.namespace = '';
  this.timing = 400;

  /*
    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.x/shorthands/
  */

  this.passthrough('https://cdn.jsdelivr.net/**');
  this.passthrough('/node_modules/typo-js/dictionaries/en_US/en_US.dic');
  this.passthrough('/node_modules/typo-js/dictionaries/en_US/en_US.dic')
  this.passthrough();
}

0 个答案:

没有答案