Skip to content

Commit 052236d

Browse files
Update README.md
1 parent 3cc33b1 commit 052236d

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,39 @@ After cloning the project with `git clone https://github.com/PlanetConectus/Loop
4343
## Launching the apps
4444

4545
in this project we tried to reduce complexity for you to get both the frontend server and the backend server in the same local machine to do this we force the binding port of the Loopback4 server to `3001`
46-
in the `LoopBack4ReactAdminExample/BackendLoopbackV4/ecommerce/src/index.ts` file, this is because you cant bind two processes to the same `[IP:PORT]` in our case the binding IP is `127.0.0.1` it's known as `localhost` , this modification will prevent `CORS blocks` by you navigator,to solve this problem we use the integrated node proxy by adding this line `"proxy": "http://localhost:3001"` in the `LoopBack4ReactAdminExample/Frontreactadmin/ecommerce/package.json`.
46+
in the `LoopBack4ReactAdminExample/BackendLoopbackV4/ecommerce/src/index.ts` file:
47+
```ruby
48+
const app = new EcommerceApplication({
49+
rest: {
50+
port: 3001
51+
}
52+
});
53+
54+
```
55+
this is because you cant bind two processes to the same `[IP:PORT]` , in our case the binding IP is `127.0.0.1` it's known as `localhost` , this modification will prevent `CORS blocks` by you navigator,to solve this problem we use the integrated node proxy by adding this line `"proxy": "http://localhost:3001"` in the `LoopBack4ReactAdminExample/Frontreactadmin/ecommerce/package.json`:
56+
```ruby
57+
{
58+
.
59+
.
60+
.
61+
. ,
62+
"scripts": {
63+
"start": "react-scripts start",
64+
"build": "react-scripts build",
65+
"test": "react-scripts test",
66+
"eject": "react-scripts eject"
67+
},
68+
"proxy": "http://localhost:3001", // <~~~ here we add the proxy field in package.json
69+
"eslintConfig": {
70+
"extends": "react-app"
71+
},
72+
.
73+
.
74+
.
75+
}
76+
77+
```
78+
4779

4880
### Start the servers
4981

0 commit comments

Comments
 (0)