home
  • Blog
2.18
  • Getting Started
  • Tutorial
  • The Object Model
  • Routing
  • Templates
  • Components
  • Controllers
  • Models
  • Application Concerns
  • Testing
  • Ember Inspector
  • Addons and Dependencies
  • Configuring Ember.js
    • Configuring Your App
    • Configuring Ember CLI
    • Handling Deprecations
    • Disabling Prototype Extensions
    • Specifying the URL Type
    • Embedding Applications
    • Feature Flags
    • Build targets
    • Debugging
  • Contributing to Ember.js
  • Glossary
Old Guides - You are viewing the guides for Ember v2.18.0.
Go to v5.0.0

Configuring Your App

Edit pencil

Ember CLI ships with support for managing your application's environment. Ember CLI will setup a default environment config file at config/environment. Here, you can define an ENV object for each environment, which are currently limited to three: development, test, and production.

The ENV object contains three important keys:

  • EmberENV can be used to define Ember feature flags (see the Feature Flags guide).
  • APP can be used to pass flags/options to your application instance.
  • environment contains the name of the current environment (development,production or test).

You can access these environment variables in your application code by importing from your-application-name/config/environment.

For example:

import ENV from 'your-application-name/config/environment';

if (ENV.environment === 'development') {
  // ...
}
left arrow
Managing Dependencies
Configuring Ember CLI
right arrow
Team Sponsors Security Legal Branding Community Guidelines
Twitter GitHub Discord Mastodon

If you want help you can contact us by email, open an issue, or get realtime help by joining the Ember Discord.

© Copyright 2023 - Tilde Inc.
Ember.js is free, open source and always will be.


Ember is generously supported by
blue