Skip to content

Commit 19a82fb

Browse files
authored
Feat: 배포 환경에 따른 환경 변수 설정 (#428)
1 parent 99a8257 commit 19a82fb

File tree

6 files changed

+10
-19
lines changed

6 files changed

+10
-19
lines changed

Diff for: .gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ dist-ssr
2323
*.sln
2424
*.sw?
2525

26-
.env
26+
.env
27+
.env.development
28+
.env.production

Diff for: package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
"private": true,
44
"version": "0.0.0",
55
"type": "module",
6-
"proxy": "http://localhost:8080",
76
"scripts": {
8-
"dev": "vite",
9-
"build": "tsc && vite build",
7+
"dev": "vite --mode development",
8+
"build": "tsc && vite build --mode production",
109
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
1110
"preview": "vite preview",
1211
"test": "jest",

Diff for: src/apis/axios/axios.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ACCESS_TOKEN } from "@/constants/localStorageKey";
22
import axios, { AxiosResponse } from "axios";
33

4-
const BASE_URL = "http://localhost:8080/api";
4+
const BASE_URL = `${import.meta.env.VITE_API_URL}/api`;
55

66
const instanceConfig = {
77
baseURL: BASE_URL,

Diff for: src/apis/postPaymentSuccess.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const postPaymentSuccess = async ({
2121
};
2222

2323
await instance
24-
.post("http://localhost:8080/api/payment/toss/success", body, {
24+
.post(`${import.meta.env.VITE_API_URL}/api/payment/toss/success`, body, {
2525
headers: {
2626
Authorization: encryptedSecretKey,
2727
},

Diff for: src/components/LogIn/GithubLoginButton/GithubLoginButton.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import githubLogo from "@/assets/icon/github-mark.svg";
22
import Button from "@/components/LogIn/Button/Button";
33

44
function GithubLoginButton() {
5-
const GITHUB_REDIRECT_URI =
6-
"http://localhost:8080/oauth2/authorization/github";
5+
const GITHUB_REDIRECT_URI = `${
6+
import.meta.env.VITE_API_URL
7+
}/oauth2/authorization/github`;
78

89
const onClick = () => {
910
window.location.href = GITHUB_REDIRECT_URI;

Diff for: src/setupProxy.js

-11
This file was deleted.

0 commit comments

Comments
 (0)