Skip to content

Commit f3dc503

Browse files
authored
Merge pull request #2 from Mr-Dy986:create-react-app
docs: fix link of "Building for Relative Paths" (facebook#12691)
2 parents 7496d25 + 8f83fe3 commit f3dc503

File tree

3 files changed

+131
-14
lines changed

3 files changed

+131
-14
lines changed

web-order/db.json

Lines changed: 119 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,124 @@
11
{
2-
"posts": [
2+
"products": [
33
{
4-
"id": 1,
5-
"title": "json-server",
6-
"author": "typicode"
7-
}
8-
],
9-
"comments": [
4+
"id": 123,
5+
"name": "Water",
6+
"price": "1500",
7+
"image": "https://thestreet7makara.sharepoint.com/sites/aronium/Shared%20Documents/General/Aronium/Pictures/Vital-500ml.png?Web=1"
8+
},
9+
{
10+
"id": 124,
11+
"name": "CocaCola",
12+
"price": "2500",
13+
"image": "https://thestreet7makara.netlify.app/static/media/CocaColaCan.14d086250d6126819bb5.png"
14+
},
15+
{
16+
"id": 125,
17+
"name": "Sprite",
18+
"price": "2500",
19+
"image": "https://thestreet7makara.netlify.app/static/media/SpriteCan.f96267703e07d2c76f22.png"
20+
},
21+
{
22+
"id": 126,
23+
"name": "Samurai",
24+
"price": "2500",
25+
"image": "https://thestreet7makara.netlify.app/static/media/SamuraiStrawberryCan.c04659194b98d6750a69.png"
26+
},
27+
{
28+
"id": 127,
29+
"name": "ReadBull",
30+
"price": "3000",
31+
"image": "https://thestreet7makara.netlify.app/static/media/RedBullCan.fb2e9f353a759a4aa8fc.png"
32+
},
33+
{
34+
"id": 128,
35+
"name": "Water",
36+
"price": "1500",
37+
"image": "https://thestreet7makara.sharepoint.com/sites/aronium/Shared%20Documents/General/Aronium/Pictures/Vital-500ml.png?Web=1"
38+
},
39+
{
40+
"id": 129,
41+
"name": "CocaCola",
42+
"price": "2500",
43+
"image": "https://thestreet7makara.netlify.app/static/media/CocaColaCan.14d086250d6126819bb5.png"
44+
},
45+
{
46+
"id": 130,
47+
"name": "Sprite",
48+
"price": "2500",
49+
"image": "https://thestreet7makara.netlify.app/static/media/SpriteCan.f96267703e07d2c76f22.png"
50+
},
51+
{
52+
"id": 131,
53+
"name": "Samurai",
54+
"price": "2500",
55+
"image": "https://thestreet7makara.netlify.app/static/media/SamuraiStrawberryCan.c04659194b98d6750a69.png"
56+
},
57+
{
58+
"id": 132,
59+
"name": "ReadBull",
60+
"price": "3000",
61+
"image": "https://thestreet7makara.netlify.app/static/media/RedBullCan.fb2e9f353a759a4aa8fc.png"
62+
},
63+
{
64+
"id": 133,
65+
"name": "Water",
66+
"price": "1500",
67+
"image": "https://thestreet7makara.sharepoint.com/sites/aronium/Shared%20Documents/General/Aronium/Pictures/Vital-500ml.png?Web=1"
68+
},
69+
{
70+
"id": 134,
71+
"name": "CocaCola",
72+
"price": "2500",
73+
"image": "https://thestreet7makara.netlify.app/static/media/CocaColaCan.14d086250d6126819bb5.png"
74+
},
75+
{
76+
"id": 135,
77+
"name": "Sprite",
78+
"price": "2500",
79+
"image": "https://thestreet7makara.netlify.app/static/media/SpriteCan.f96267703e07d2c76f22.png"
80+
},
81+
{
82+
"id": 136,
83+
"name": "Samurai",
84+
"price": "2500",
85+
"image": "https://thestreet7makara.netlify.app/static/media/SamuraiStrawberryCan.c04659194b98d6750a69.png"
86+
},
87+
{
88+
"id": 137,
89+
"name": "ReadBull",
90+
"price": "3000",
91+
"image": "https://thestreet7makara.netlify.app/static/media/RedBullCan.fb2e9f353a759a4aa8fc.png"
92+
},
93+
{
94+
"id": 138,
95+
"name": "Water",
96+
"price": "1500",
97+
"image": "https://thestreet7makara.sharepoint.com/sites/aronium/Shared%20Documents/General/Aronium/Pictures/Vital-500ml.png?Web=1"
98+
},
99+
{
100+
"id": 139,
101+
"name": "CocaCola",
102+
"price": "2500",
103+
"image": "https://thestreet7makara.netlify.app/static/media/CocaColaCan.14d086250d6126819bb5.png"
104+
},
105+
{
106+
"id": 140,
107+
"name": "Sprite",
108+
"price": "2500",
109+
"image": "https://thestreet7makara.netlify.app/static/media/SpriteCan.f96267703e07d2c76f22.png"
110+
},
111+
{
112+
"id": 141,
113+
"name": "Samurai",
114+
"price": "2500",
115+
"image": "https://thestreet7makara.netlify.app/static/media/SamuraiStrawberryCan.c04659194b98d6750a69.png"
116+
},
10117
{
11-
"id": 1,
12-
"body": "some comment",
13-
"postId": 1
118+
"id": 142,
119+
"name": "ReadBull",
120+
"price": "3000",
121+
"image": "https://thestreet7makara.netlify.app/static/media/RedBullCan.fb2e9f353a759a4aa8fc.png"
14122
}
15-
],
16-
"profile": {
17-
"name": "typicode"
18-
}
123+
]
19124
}

web-order/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"@testing-library/user-event": "^13.5.0",
99
"axios": "^1.1.2",
1010
"bootstrap": "^5.2.2",
11+
"http-proxy-middleware": "^2.0.6",
1112
"react": "^18.2.0",
1213
"react-bootstrap": "^2.5.0",
1314
"react-dom": "^18.2.0",

web-order/src/setupProxy.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const { createProxyMiddleware } = require('http-proxy-middleware');
2+
3+
module.exports = function (app) {
4+
app.use(
5+
'/api',
6+
createProxyMiddleware({
7+
target: 'http://localhost:5000',
8+
changeOrigin: true,
9+
})
10+
);
11+
};

0 commit comments

Comments
 (0)