Fetch API에서 Axios로 변경

This commit is contained in:
ByungyeonKim
2021-11-01 18:41:13 +09:00
parent 4096552fdd
commit 8627eea3ac
2 changed files with 5 additions and 1 deletions

View File

@@ -8,6 +8,7 @@
content="width=device-width, initial-scale=1.0"
/>
<title>ZUM 허브 - 일상을 읽다</title>
<script src="https://unpkg.com/axios/dist/axios.min.js" defer></script>
<script src="./main.js" type="module" defer></script>
<link rel="stylesheet" href="style.css" />
</head>

View File

@@ -6,7 +6,10 @@ import store from './src/store.js';
import Detail from './src/components/detail.js';
const category = ['life', 'food', 'trip', 'culture'];
const contents = new Contents();
const httpClient = axios.create({
baseURL: 'http://localhost:3000/api',
});
const contents = new Contents(httpClient);
for (const name of category) {
contents //