Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 768
Manikandan Avatar asked Aug 01 '16 15:08

Manikandan


2 Answers

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
  };
}
like image 150
Sam Selikoff Avatar answered Sep 20 '22 15:09

Sam Selikoff


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

like image 26
Alessio Calafiore Avatar answered Sep 21 '22 15:09

Alessio Calafiore