1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 05:09:42 +02:00
documize/app/config/environment.js

104 lines
2.5 KiB
JavaScript
Raw Normal View History

2016-07-07 18:54:16 -07:00
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
/* jshint node: true */
module.exports = function (environment) {
var ENV = {
modulePrefix: 'documize',
podModulePrefix: 'documize/pods',
locationType: process.env.EMBER_CLI_ELECTRON ? 'hash' : 'auto',
2016-07-07 18:54:16 -07:00
environment: environment,
rootURL: process.env.EMBER_CLI_ELECTRON ? null : '/',
2016-07-07 18:54:16 -07:00
apiHost: '',
apiNamespace: '',
contentSecurityPolicyHeader: 'Content-Security-Policy-Report-Only',
EmberENV: {
FEATURES: {}
},
"ember-cli-mirage": {
enabled: false
},
'ember-simple-auth': {
authenticationRoute: 'auth.login',
2016-11-06 20:11:21 -08:00
routeAfterAuthentication: 'folders',
routeIfAlreadyAuthenticated: 'folders'
2016-07-07 18:54:16 -07:00
},
APP: {
// Allows to disable audit service in tests
auditEnabled: true,
intercomKey: ""
}
};
if (environment === 'development') {
ENV.APP.LOG_TRANSITIONS = true;
ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
2016-11-06 20:11:21 -08:00
ENV.APP.LOG_RESOLVER = false;
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;
2016-07-07 18:54:16 -07:00
ENV['ember-cli-mirage'] = {
enabled: false
};
ENV.apiHost = "https://localhost:5001";
ENV.apiNamespace = "api";
}
if (environment === 'test') {
ENV.APP.LOG_RESOLVER = false;
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;
ENV.APP.LOG_TRANSITIONS = true;
// ENV.APP.LOG_TRANSITIONS_INTERNAL = false;
ENV.baseURL = '/';
ENV.locationType = 'none';
ENV.APP.rootElement = '#ember-testing';
ENV['ember-cli-mirage'] = {
enabled: true
};
ENV.APP.auditEnabled = false;
ENV.apiHost = "https://localhost:5001";
}
if (environment === 'production') {
ENV.APP.LOG_RESOLVER = false;
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;
ENV.APP.LOG_TRANSITIONS = false;
ENV.APP.LOG_TRANSITIONS_INTERNAL = false;
ENV.apiHost = "";
}
process.argv.forEach(function (element) {
if (element !== undefined) {
if (element.startsWith("intercom=")) {
element = element.replace("intercom=", "");
ENV.APP.intercomKey = element;
}
if (element.startsWith("apiHost=")) {
element = element.replace("apiHost=", "");
ENV.apiHost = element;
}
}
});
ENV.apiNamespace = "api";
ENV.contentSecurityPolicy = null;
return ENV;
2016-10-04 15:24:21 -07:00
};