Skip to content

Commit

Permalink
Merge pull request #29 from juztamau5/nginx
Browse files Browse the repository at this point in the history
Add nginx config to README.md
  • Loading branch information
TheExpandingPolytope committed Jun 23, 2023
2 parents 028c4b6 + 4ac55f4 commit b677590
Show file tree
Hide file tree
Showing 3 changed files with 487 additions and 13,575 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,50 @@ The response should be something like this:
[ { epoch: '0', input: '1', notice: '0', payload: 'Hello there' } ]
```
## Developing with the frontend
To start the frontend dev server, run the following commands:
```shell
cd front
yarn install
yarn dev
```
To proxy the CORS headers, you can use nginx. Create the following file at `/etc/nginx/site-enabled/new-conf.conf`:
```
server {
listen 3001;
add_header 'Access-Control-Allow-Origin' 'http://localhost:3002' always;
location / {
proxy_pass http://localhost:5173;
}
}

server {
listen 3002;
location / {
proxy_pass http://localhost:5005;
}
}


server {
listen 3003;
add_header Access-Control-Allow-Origin *;
location / {
proxy_pass http://localhost:3000;
}
}
```
Then restart nginx:
```shell
sudo systemctl restart nginx
```
## Deploying to a testnet
Deploying the application to a blockchain requires creating a smart contract on that network, as well as running a validator node for the DApp.
Expand Down
Loading

0 comments on commit b677590

Please sign in to comment.