Manikandan
Manikandan

Reputation: 1234

Remove ember-cli-mirage from ember

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 !!

Upvotes: 6

Views: 2206

Answers (2)

Alessio Calafiore
Alessio Calafiore

Reputation: 91

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

Upvotes: 4

Sam Selikoff
Sam Selikoff

Reputation: 12704

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
  };
}

Upvotes: 10

Related Questions