Feat: Add api functions

This commit is contained in:
jhynsoo 2024-05-13 14:37:12 +09:00
parent 518b7a6bba
commit 3e2c6f7195
2 changed files with 9 additions and 12 deletions

View File

@ -1,6 +1,6 @@
import { localAxios } from '@/utils/http-commons';
const local = localAxios();
const local = localAxios;
function getArticles(success, fail) {
//list

View File

@ -1,15 +1,12 @@
import axios from 'axios';
// const { VITE_API_BASE_URL } ="http://localhost/";
function localAxios() {
const instance = axios.create({
baseURL: 'http://localhost',
headers: {
'Content-Type': 'application/json;charset=utf-8',
},
});
return instance;
}
const localAxios = axios.create({
baseURL: 'http://localhost:8000',
headers: {
'Content-type': 'application/json;charset=utf-8',
'Access-Control-Allow-Origin': 'http://localhost:5173',
},
withCredentials: true,
});
export { localAxios };