File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 1
- HTTPS = true
1
+ HTTPS = true
2
+ REACT_APP_API_HOST = https://v2.velog.io/
Original file line number Diff line number Diff line change 1
1
import axios from 'axios' ;
2
2
3
- const apiClient = axios . create ( ) ;
3
+ const host =
4
+ process . env . NODE_ENV === 'development'
5
+ ? '/'
6
+ : process . env . REACT_APP_API_HOST || '/' ;
7
+ const apiClient = axios . create ( {
8
+ baseURL : host ,
9
+ } ) ;
4
10
5
11
export default apiClient ;
Original file line number Diff line number Diff line change 1
1
import ApolloClient from 'apollo-boost' ;
2
2
import { InMemoryCache } from 'apollo-cache-inmemory' ;
3
3
4
+ const host =
5
+ ( process . env . NODE_ENV === 'development'
6
+ ? '/'
7
+ : process . env . REACT_APP_API_HOST ) || '/' ;
8
+
9
+ const graphqlURI = host . concat ( 'graphql' ) ;
10
+
4
11
const client = new ApolloClient ( {
5
- uri : '/graphql' ,
12
+ uri : graphqlURI ,
6
13
cache : new InMemoryCache ( ) . restore ( ( window as any ) . __APOLLO_STATE__ ) ,
7
14
} ) ;
8
15
You can’t perform that action at this time.
0 commit comments