Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

Commit

Permalink
Take host into account when building api URL.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob van Mourik committed Apr 9, 2016
1 parent 0443320 commit ac9fa34
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions addon/services/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ export default AjaxService.extend({
* @return {String} The full URL
*/
buildURL(path, options = {}) {
return this._buildURL(this._buildApiURL(path, options));
},

/**
* @method _buildApiURL
* @private
* @param {String} path
* @param {Object} options
* @return {String}
*/
_buildApiURL(path, options = {}) {
let id = null,
snapshot = null,
requestType = null,
Expand Down Expand Up @@ -61,7 +72,7 @@ export default AjaxService.extend({
}

return result;
},
},

/**
* @method options
Expand All @@ -71,7 +82,7 @@ export default AjaxService.extend({
* @return {Object}
*/
options(url, options = {}) {
url = this.buildURL(url, options);
url = this._buildApiURL(url, options);

if (options.jsonData) {
options.data = JSON.stringify(options.jsonData);
Expand Down

0 comments on commit ac9fa34

Please sign in to comment.