File tree 2 files changed +11
-11
lines changed 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ Set Proxy to deloy Heroku:
27
27
npm install || yarn install
28
28
29
29
2 . Create static.json file
30
+ ``` json
30
31
{
31
32
"root" : " build/" ,
32
33
"clean_urls" : false ,
@@ -44,15 +45,15 @@ Set Proxy to deloy Heroku:
44
45
"origin" : " ${API_URL}"
45
46
}
46
47
}
47
- }
48
-
48
+ }<br/>
49
+ ```
49
50
3 . Push file to heroku
50
51
git push heroku master
51
52
52
53
4 . Config proxy heroku
53
- All request from react contain "/api/abc" -> "/abc"
54
- For example:
55
- From react: axios.get("/api/search-items") → ${API_URL}/search-items
56
- From react: axios.get("/api/users/me") → ${API_URL}/users/me
57
- (!)Therefore, run this cmd to set proxy var in heroku:
58
- heroku config: set API_URL="https://backend.example.com/api "
54
+ All request from react contain "/api/abc" -> "/abc" < br />
55
+ For example:< br />
56
+ From react: axios.get("/api/search-items") → ${API_URL}/search-items < br />
57
+ From react: axios.get("/api/users/me") → ${API_URL}/users/me< br />
58
+ (!)Therefore, run this cmd to set proxy var in heroku: < br />
59
+ heroku config: set API_URL="https://backend.example.com/api " < br />
Original file line number Diff line number Diff line change 13
13
"react-redux" : " ^7.2.1" ,
14
14
"react-scripts" : " 3.4.3" ,
15
15
"redux" : " ^4.0.5" ,
16
- "redux-thunk" : " ^2.3.0" ,
17
- "uuid" : " ^8.3.0"
16
+ "redux-thunk" : " ^2.3.0"
18
17
},
19
18
"scripts" : {
20
19
"start" : " react-scripts start" ,
38
37
]
39
38
},
40
39
"proxy" : " https://vhk-services-api.herokuapp.com/"
41
- }
40
+ }
You can’t perform that action at this time.
0 commit comments