How to disable HTTP-Mock server within environment config file

@dennismende - Wrap your the section in your server/index.js in an if and check for an environment variable.

Replace the following line

 mocks.forEach(function(route) { route(app); });

With something like this:

if (process.env.DISABLE_MOCK !== 'true') {
  mocks.forEach(function(route) { route(app); });
}

Then use that ENV variable to enable or disable the mocks as desired:

DISABLE_MOCK=true ember serve
3 Likes