Skip to content

Commit

Permalink
MERGE: #165 from yesolyo/FE-release/add-env
Browse files Browse the repository at this point in the history
CHORE: env 셋팅 (#164)
  • Loading branch information
yesolyo authored Jun 1, 2023
2 parents 5a10d94 + e903819 commit 45cbb70
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 15 deletions.
3 changes: 3 additions & 0 deletions FE/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
REACT_APP_CLIENT_ID=3b1dfca72b24afb9ebb2
REACT_APP_REDIRECT_URI=http://localhost:3000/auth
REACT_APP_BASE_URI=http://13.209.232.172:8080
20 changes: 16 additions & 4 deletions FE/package-lock.json

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

1 change: 1 addition & 0 deletions FE/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"dotenv": "^16.1.3",
"jsonwebtoken": "^9.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
Empty file removed FE/src/.env
Empty file.
2 changes: 1 addition & 1 deletion FE/src/pages/Auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { fetchData } from '../utils/fetch';

export const Auth = () => {
const navigate = useNavigate();
const AUTH_URI = 'http://13.209.232.172:8080/githublogin';
const AUTH_URI = `${process.env.REACT_APP_BASE_URI}/githublogin`;
const url = new URL(window.location.href);
const queryCode = url.searchParams.get('code');

Expand Down
4 changes: 2 additions & 2 deletions FE/src/pages/IssueDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export const IssueDetail = () => {
const initData = async () => {
try {
const [issueInfo, commentInfo] = await fetchAll(
`http://13.209.232.172:8080/issues/${id}`,
`http://13.209.232.172:8080/issues/${id}/comments?issueId=${id}`
`${process.env.REACT_APP_BASE_URI}/issues/${id}`,
`${process.env.REACT_APP_BASE_URI}/issues/${id}/comments?issueId=${id}`
);
setIssue(issueInfo);
setComments(commentInfo);
Expand Down
6 changes: 4 additions & 2 deletions FE/src/pages/IssueList.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ export const IssueList = () => {
const initData = async () => {
try {
const [issuesInfo, countInfo] = await fetchAll(
`http://13.209.232.172:8080/issues${getFilterQueryString(filterState)}`,
`http://13.209.232.172:8080/issues/countInfo`
`${process.env.REACT_APP_BASE_URI}/issues${getFilterQueryString(
filterState
)}`,
`${process.env.REACT_APP_BASE_URI}/issues/countInfo`
);
setIssuesInfo(issuesInfo);
setCountInfo(countInfo);
Expand Down
6 changes: 3 additions & 3 deletions FE/src/pages/LabelList.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export const LabelList = () => {
const initData = async () => {
try {
const [labelsInfo, countInfo] = await fetchAll(
'http://13.209.232.172:8080/labels',
'http://13.209.232.172:8080/issues/countInfo'
`${process.env.REACT_APP_BASE_URI}/labels`,
`${process.env.REACT_APP_BASE_URI}/issues/countInfo`
);
setLabels(labelsInfo);
setCountInfo(countInfo);
Expand Down Expand Up @@ -60,7 +60,7 @@ export const LabelList = () => {
};

const handleDelete = async (id) => {
const url = `http://13.209.232.172:8080/labels/${id}`;
const url = `${process.env.REACT_APP_BASE_URI}/labels/${id}`;
const idData = {
labelId: id
};
Expand Down
6 changes: 3 additions & 3 deletions FE/src/pages/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export const Login = () => {

const focusStyle = isLogin ? null : colors.red;

const CLIENT_ID = '3b1dfca72b24afb9ebb2';
const REDIRECT_URI = 'http://localhost:3000/auth&scope=user';
const loginUri = `https://github.com/login/oauth/authorize?client_id=${CLIENT_ID}&redirect_uri=${REDIRECT_URI}`;
const CLIENT_ID = process.env.REACT_APP_CLIENT_ID;
const REDIRECT_URI = process.env.REACT_APP_REDIRECT_URI;
const loginUri = `https://github.com/login/oauth/authorize?client_id=${CLIENT_ID}&redirect_uri=${REDIRECT_URI}&scope=user`;

const githubLoginHandler = () => {
window.location.href = loginUri;
Expand Down

0 comments on commit 45cbb70

Please sign in to comment.