2016-08-16 123 views
0

/config/environment.js在Ember.JS中,如何安全地加載敏感環境數據?

/* jshint node: true */ 

module.exports = function(environment) { 
    var ENV = { 
    modulePrefix: 'bumbox', 
    podModulePrefix: 'bumbox/pods', 
    environment: environment, 
    baseURL: '/', 
    locationType: 'auto', 
    EmberENV: { 
     FEATURES: { 
     // Here you can enable experimental features on an ember canary build 
     // e.g. 'with-controller': true 
     } 
    }, 

    APP: { 
     // Here you can pass flags/options to your application instance 
     // when it is created 
    } 
    }; 

    if (environment === 'development') { 
    // ENV.APP.LOG_RESOLVER = true; 
    // ENV.APP.LOG_ACTIVE_GENERATION = true; 
    // ENV.APP.LOG_TRANSITIONS = true; 
    // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 
    // ENV.APP.LOG_VIEW_LOOKUPS = true; 
    } 

    if (environment === 'test') { 
    // Testem prefers this... 
    ENV.baseURL = '/'; 
    ENV.locationType = 'none'; 

    // keep test console output quieter 
    ENV.APP.LOG_ACTIVE_GENERATION = false; 
    ENV.APP.LOG_VIEW_LOOKUPS = false; 

    ENV.APP.rootElement = '#ember-testing'; 
    } 

    ENV['ember-simple-auth'] = { 
    authenticationRoute: 'index', 
    routeAfterAuthentication: 'protected', 
    routeIfAlreadyAuthenticated: 'protected' 
    }; 

    return ENV; 
}; 

我有一定的特性,我需要添加到ENV對象,但我想那些屬性而存儲在一個單獨的,.gitignore「d文件,所以我不將它們發佈到github上。類似於/config/protected.js

回答

相關問題