Files
line-of-sight/frontend/src/services/api.js
T
(jenkins) eda4697b03
Tests / backend-test (pull_request) Successful in 7s
Tests / frontend-test (pull_request) Failing after 8s
Tests / e2e-test (pull_request) Failing after 1m29s
Route api traffic through the main container.
2026-04-16 23:59:14 +01:00

26 lines
581 B
JavaScript

import axios from 'axios';
const API_BASE_URL = import.meta.env.VITE_API_URL || '/api';
const api = axios.create({
baseURL: API_BASE_URL,
timeout: 10000,
headers: {
'Content-Type': 'application/json'
}
});
export const getLineOfSight = async (lat, lon, direction, tolerance) => {
const response = await api.get('/line-of-sight', {
params: { lat, lon, direction, tolerance }
});
return response;
};
export const healthCheck = async () => {
const response = await api.get('/health');
return response;
};
export default { getLineOfSight, healthCheck };