Skip to content

Commit

Permalink
fix: change the management location of API_BASE_URL
Browse files Browse the repository at this point in the history
react-native-config is not work when build ios in arm64
This error is addressed in issue #28.

#19
  • Loading branch information
timepresent95 committed Aug 6, 2024
1 parent 4f74e57 commit 759bb22
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/api/axios.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//FIXME: 서버 작업이 완료되면 axios 모듈 사용으로 수정해야 함
import axios from 'axios';
import {Config} from 'react-native-config';
// import axios from '@/mock/mockAxios';

import {API_BASE_URL} from '@/constants/api';

const axiosInstance = axios.create({
baseURL: Config.API_BASE_URL,
baseURL: API_BASE_URL,
timeout: 5000,
withCredentials: true,
});
Expand Down
1 change: 1 addition & 0 deletions src/constants/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const API_BASE_URL = 'http://family-farm-mobile-base-url';
3 changes: 1 addition & 2 deletions src/mocks/handlers/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {http, HttpResponse} from 'msw';
import {Config} from 'react-native-config';

const {BASE_URL: API_BASE_URL} = Config;
import {API_BASE_URL} from '@/constants/api';

const getHandlers = [
http.get(API_BASE_URL + '/auth/signout', () => {
Expand Down

0 comments on commit 759bb22

Please sign in to comment.