live updates and file organization
This commit is contained in:
23
frontend/src/lib/api.js
Normal file
23
frontend/src/lib/api.js
Normal file
@@ -0,0 +1,23 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user