Skip to content

Commit

Permalink
feat: 환경 설정
Browse files Browse the repository at this point in the history
package json 수정, base api 수정
  • Loading branch information
SujinKim1127 committed Nov 22, 2023
1 parent 338efad commit c79c180
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 93 deletions.
103 changes: 14 additions & 89 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,17 @@
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.14.18",
"@mui/material": "^5.14.18",

"@mui/x-date-pickers": "^6.18.1",

"@svgr/webpack": "^8.1.0",
"axios": "^1.5.1",
"dayjs": "^1.11.10",
"next": "latest",
"react": "latest",
"react-dom": "latest",

"react-kakao-maps-sdk": "^1.1.24",
"recharts": "^2.10.1",
"recoil": "^0.7.7",
"recoil-persist": "^5.1.0"

},
"devDependencies": {
"@types/node": "latest",
Expand Down
18 changes: 18 additions & 0 deletions pages/api/axiosInstance.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import axios from "axios";

const userSession = sessionStorage.getItem("userSession");
let token: string = "";
if (userSession) {
const parsedSession = JSON.parse(userSession);
token = parsedSession.user?.token || "";
} else {
console.log("유저세션 없음");
}

export const axiosInstance = axios.create({
baseURL: process.env.NEXT_PUBLIC_BASE_API,
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,
},
});

0 comments on commit c79c180

Please sign in to comment.