diff --git a/app/routes/commentary-article.js b/app/routes/commentary-article.js index 7d09682..f4b7ab8 100644 --- a/app/routes/commentary-article.js +++ b/app/routes/commentary-article.js @@ -1,10 +1,11 @@ import Route from '@ember/routing/route'; import fetch from 'fetch'; import { htmlSafe } from '@ember/template'; +import ENV from 'gwt-frontend/config/environment'; export default class CommentaryArticleRoute extends Route { async model(params) { - const response = await fetch(window.GwtFrontend.hostUrl + '/api/v1/commentary/articles/' + params.article_id); + const response = await fetch(ENV.APP.hostUrl + '/api/v1/commentary/articles/' + params.article_id); const body = await response.text().then(function(text){ return new htmlSafe(text); }); diff --git a/app/routes/commentary-intro.js b/app/routes/commentary-intro.js index 4c758f8..7671d13 100644 --- a/app/routes/commentary-intro.js +++ b/app/routes/commentary-intro.js @@ -1,10 +1,12 @@ import Route from '@ember/routing/route'; import fetch from 'fetch'; import { htmlSafe } from '@ember/template'; +import ENV from 'gwt-frontend/config/environment'; export default class CommentaryIntroRoute extends Route { async model(params) { - const response = await fetch(window.GwtFrontend.hostUrl + '/api/v1/commentary/' + params.book_id + '/chapter/intro'); + console.log(ENV); + const response = await fetch(ENV.APP.hostUrl + '/api/v1/commentary/' + params.book_id + '/chapter/intro'); const body = await response.text().then(function(text){ return new htmlSafe(text); });