|
|
@@ -1,9 +1,14 @@
|
|
|
import axios from 'axios';
|
|
|
+import { useLocation } from 'react-router';
|
|
|
+
|
|
|
+const env = process.env;
|
|
|
|
|
|
class AllocationService {
|
|
|
BASE_URL = process.env.BASE_URL || 'http://localhost:9090/allocation';
|
|
|
|
|
|
async fetchAllocation(win, aggregate, options) {
|
|
|
+ const url = process.env.BASE_URL ?? "";
|
|
|
+ const baseUrl = `${url}${this.BASE_PATH}`;
|
|
|
const { accumulate, filters, } = options;
|
|
|
const params = {
|
|
|
window: win,
|
|
|
@@ -13,7 +18,7 @@ class AllocationService {
|
|
|
if (typeof accumulate === 'boolean') {
|
|
|
params.accumulate = accumulate;
|
|
|
}
|
|
|
- const result = await axios.get(`${this.BASE_URL}/compute`, { params });
|
|
|
+ const result = await axios.get(`${baseUrl}/compute`, { params });
|
|
|
return result.data;
|
|
|
}
|
|
|
}
|