aaaaa
This commit is contained in:
commit
5ab2d8abfd
45 changed files with 9738 additions and 0 deletions
20
src/lib/services/api.js
Normal file
20
src/lib/services/api.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import axios from "axios";
|
||||
const API_BASE_URL = 'http://localhost:3000/api';
|
||||
|
||||
const apiClient = axios.create({
|
||||
baseURL: API_BASE_URL,
|
||||
timeout: 10000,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
}
|
||||
});
|
||||
|
||||
apiClient.interceptors.response.use(
|
||||
(response) => response,
|
||||
(error) => {
|
||||
console.error('API Error:', error);
|
||||
throw error;
|
||||
}
|
||||
);
|
||||
|
||||
export default apiClient;
|
||||
Loading…
Add table
Add a link
Reference in a new issue