You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docusaurus/docs/proxying-api-requests-in-development.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,9 @@ sidebar_label: Proxying in Development
9
9
People often serve the front-end React app from the same host and port as their backend implementation.<br>
10
10
For example, a production setup might look like this after the app is deployed:
11
11
12
-
```
13
-
/ - static server returns index.html with React app
14
-
/todos - static server returns index.html with React app
15
-
/api/todos - server handles any /api/* requests using the backend implementation
16
-
```
12
+
/ - static server returns index.html with React app
13
+
/todos - static server returns index.html with React app
14
+
/api/todos - server handles any /api/* requests using the backend implementation
17
15
18
16
Such setup is **not** required. However, if you **do** have a setup like this, it is convenient to write requests like `fetch('/api/todos')` without worrying about redirecting them to another host or port during development.
0 commit comments