24 lines
488 B
JavaScript
24 lines
488 B
JavaScript
import axios from 'axios';
|
|
|
|
const API_BASE = process.env.REACT_APP_API_BASE || '';
|
|
|
|
const client = axios.create({
|
|
baseURL: API_BASE,
|
|
// optional: set a short timeout for UI requests
|
|
timeout: 8000,
|
|
});
|
|
|
|
export async function get(path, config) {
|
|
return client.get(path, config);
|
|
}
|
|
|
|
export async function post(path, data, config) {
|
|
return client.post(path, data, config);
|
|
}
|
|
|
|
export async function del(path, config) {
|
|
return client.delete(path, config);
|
|
}
|
|
|
|
export default client;
|