diff --git a/.env.dev b/.env.dev index 55347da4..ce179999 100644 --- a/.env.dev +++ b/.env.dev @@ -1,2 +1,3 @@ API_URL=https://api.dev.ror.org SENTRY_DSN=https://1c334995f85448b1afa561c8ccf13791@sentry.io/1422597 +BASE_URL=https://dev.ror.org diff --git a/.env.production b/.env.production index 895a7f6c..e47e9e0e 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1,3 @@ API_URL=https://api.ror.org SENTRY_DSN=https://1c334995f85448b1afa561c8ccf13791@sentry.io/1422597 +BASE_URL=https://ror.org diff --git a/.env.staging b/.env.staging index e45872cf..48631c10 100644 --- a/.env.staging +++ b/.env.staging @@ -1,2 +1,3 @@ API_URL=https://api.staging.ror.org SENTRY_DSN=https://1c334995f85448b1afa561c8ccf13791@sentry.io/1422597 +BASE_URL=https://staging.ror.org diff --git a/app/index.html b/app/index.html index 4add0b34..169fa9a8 100755 --- a/app/index.html +++ b/app/index.html @@ -18,7 +18,7 @@ - + diff --git a/config/environment.js b/config/environment.js index 9bd87282..ee8e1806 100644 --- a/config/environment.js +++ b/config/environment.js @@ -2,7 +2,7 @@ module.exports = function(environment) { const pkg = require('../package.json'); - + let ENV = { modulePrefix: 'ror-app', environment, @@ -20,6 +20,7 @@ module.exports = function(environment) { }, API_URL: process.env.API_URL || "https://api.ror.org", + BASE_URL: process.env.BASE_URL || null, SENTRY_DSN: process.env.SENTRY_DSN || null, VERSION: pkg.version, APP_NAME: pkg.name, diff --git a/lib/base-url/index.js b/lib/base-url/index.js new file mode 100644 index 00000000..2c665a94 --- /dev/null +++ b/lib/base-url/index.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = { + name: require('./package').name, + + isDevelopingAddon() { + return true; + }, + contentFor: function(type, config){ + if (type === 'baseURL'){ + return `${config.BASE_URL}` + ; + } + } +}; diff --git a/lib/base-url/package.json b/lib/base-url/package.json new file mode 100644 index 00000000..442a2ff8 --- /dev/null +++ b/lib/base-url/package.json @@ -0,0 +1,6 @@ +{ + "name": "base-url", + "keywords": [ + "ember-addon" + ] +} diff --git a/package.json b/package.json index f21595a8..2929130b 100644 --- a/package.json +++ b/package.json @@ -66,5 +66,10 @@ "dependencies": { "@sentry/browser": "^5.10.2", "@sentry/integrations": "^5.10.2" + }, + "ember-addon": { + "paths": [ + "lib/base-url" + ] } }