Replace graph with an svg path

This commit is contained in:
2020-10-07 23:27:30 +02:00
parent 60bbf7a890
commit 7bdaf1f619
7 changed files with 159 additions and 111 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
import axios from "axios";
export default axios.create({
baseURL: "https://dijkstra-backend.herokuapp.com/",
baseURL: "http://localhost:4000",
responseType: "json"
});
+40
View File
@@ -0,0 +1,40 @@
import Axios from './API';
export async function fetchRoads() {
try {
const { data } = await Axios.get(
`api/roads`
);
return data
} catch (error) {
console.error(error);
}
};
export async function fetchCities() {
try {
const { data } = await Axios.get(
`api/countries/1`
);
return data
} catch (error) {
console.error(error);
}
};
export async function getShortestPath(startingPointId, destinationID) {
try {
const response = await Axios.get(
`api/path`,
{
params: {
start_city_id: startingPointId,
end_city_id: destinationID
}
}
);
return response.data
} catch (error) {
console.error(error);
}
}