restore context path support

This commit is contained in:
Sebastian Sdorra
2018-08-27 15:47:02 +02:00
parent b09c46abcf
commit e6e1c5871a
19 changed files with 132 additions and 36 deletions

View File

@@ -1,7 +1,5 @@
// @flow
// get api base url from environment
const apiUrl = process.env.API_URL || process.env.PUBLIC_URL || "";
import { contextPath } from "./urls";
export const NOT_FOUND_ERROR = Error("not found");
export const UNAUTHORIZED_ERROR = Error("unauthorized");
@@ -34,7 +32,7 @@ export function createUrl(url: string) {
if (url.indexOf("/") !== 0) {
urlWithStartingSlash = "/" + urlWithStartingSlash;
}
return `${apiUrl}/api/rest/v2${urlWithStartingSlash}`;
return `${contextPath}/api/rest/v2${urlWithStartingSlash}`;
}
class ApiClient {