6. Port Forwarding
Port forwarding is used to use truffle unbox react to create a project with a react front-end. For using it, create a project, go to the Logger module, click on the "Terminal" panel, choose "npm-truffle" and write the below-mentioned command line.
.png?alt=media&token=ce634417-779a-45ae-86cd-2c003ba278a4)
truffle unbox react
Once you write down this command in the command line, all the libraries for the truffle to create a project with react front-end would be installed and can be accessed from the "Explorer" section, as shown in the figure below.
.png?alt=media&token=1a1f9622-e93a-4da4-8ee6-929f31740701)
Supported commands are highlighted in the figure below.
.png?alt=media&token=5a6ab77a-00b0-4ac6-b19e-352a9c4705a3)
Next, compile and deploy using the below-mentioned commands.
truffle develop
compile
migrate
Once you compile these commands, you can see an output as shown in the figure below.
.png?alt=media&token=a98cd208-7fe2-4b33-980d-8607eabd50ec)
After deployment, it will be successfully displayed in the browser.
Click Ports Click the Add Port button and enter 3000 in the input box and click the Add button to add a port of 3000. After that, we can view the running project through the local address.
.png?alt=media&token=35f2e55a-2bbb-4e07-906f-9dc08e3da6c2)
Last modified 1yr ago