11/* eslint-env node */
22'use strict' ;
33
4+ function normalizeURL ( val ) {
5+ return val . trim ( ) . replace ( / \/ $ / , '' ) ;
6+ }
7+
48module . exports = function ( environment ) {
59 const pkg = require ( '../package.json' ) ;
610
@@ -74,7 +78,7 @@ module.exports = function (environment) {
7478 'https://63201db022924202b697e03bc5e0d0ba@o239790.ingest.sentry.io/1420435' ,
7579
7680 disablePerformance : true ,
77- environment : fabricaDeployTarget || " stage"
81+ environment : fabricaDeployTarget || ' stage'
7882 }
7983 } ,
8084 'ember-cli-string-helpers' : {
@@ -148,14 +152,21 @@ module.exports = function (environment) {
148152 // when it is created
149153 } ,
150154
151- MIN_PREFIXES_AVAILABLE : minPrefixesAvailable ,
155+ MIN_PREFIXES_AVAILABLE : minPrefixesAvailable ,
152156 SHOW_N_PREFIXES : showNPrefixes ,
153- MAX_MINT_FUTURE_OFFSET : maxMintFutureOffset
157+ MAX_MINT_FUTURE_OFFSET : maxMintFutureOffset ,
158+ HANDLE_SERVER : ( ( typeof process . env . HANDLE_SERVER === 'undefined' ) || ( process . env . HANDLE_SERVER == "" ) ) ? 'https://handle.stage.datacite.org' : normalizeURL ( process . env . HANDLE_SERVER )
154159 } ;
155160
156161 if ( fabricaDeployTarget === 'stage' ) {
157162 // add staging-specific settings here
158163 ENV . COOKIE_DOMAIN = '.stage.datacite.org' ;
164+ ENV . HANDLE_SERVER = ( ( typeof process . env . HANDLE_SERVER === 'undefined' ) || ( process . env . HANDLE_SERVER == "" ) ) ? 'https://handle.stage.datacite.org' : normalizeURL ( process . env . HANDLE_SERVER ) ;
165+ }
166+
167+ if ( fabricaDeployTarget === 'test' ) {
168+ // add test-env-specific settings here
169+ ENV . HANDLE_SERVER = ( ( typeof process . env . HANDLE_SERVER === 'undefined' ) || ( process . env . HANDLE_SERVER == "" ) ) ? 'https://handle.test.datacite.org' : normalizeURL ( process . env . HANDLE_SERVER ) ;
159170 }
160171
161172 if ( fabricaDeployTarget === 'production' ) {
@@ -169,6 +180,7 @@ module.exports = function (environment) {
169180 ENV . CDN_URL = 'https://assets.datacite.org' ;
170181 ENV . HOME_URL = 'https://datacite.org' ;
171182 ENV . COOKIE_DOMAIN = '.datacite.org' ;
183+ ENV . HANDLE_SERVER = ( ( typeof process . env . HANDLE_SERVER === 'undefined' ) || ( process . env . HANDLE_SERVER == "" ) ) ? 'https://doi.org' : normalizeURL ( process . env . HANDLE_SERVER ) ;
172184 }
173185
174186 // Environment named 'test' here is the ember environment, not related to fabrica environments.
0 commit comments