Remove ember-cli-mirage from ember

2.1k Views Asked by At

I am using ember-cli-mirage to serve for requests. As I have my rails api to serve those request, how i shd remove or uninstall ember-cli-mirage from my ember ?

If am removing mirage folder, am getting build error !!

2

There are 2 best solutions below

0
Sam Selikoff On BEST ANSWER

You should leave Mirage installed (and the folder on disk) but disable the server whenever you want to use your actual backend API. This will let you use Mirage in selective environments, for example in testing.

By default, Mirage is disabled in production, and also in development when using the -proxy option.

To disable Mirage explicitly, you can set the enabled config option to false. For example, to always disable in development:

// config/environment.js
...
if (environment === 'development') {
  ENV['ember-cli-mirage'] = {
    enabled: false
  };
}
0
Alessio Calafiore On

Leave mirage installed, if you want to use your backend api just launch ember with

    ember s --proxy http://localhost:8000

if api's are running on your machine on port 8000.

More info on mirage official site: http://www.ember-cli-mirage.com/docs/v0.3.x/configuration/#enabled