02-02 Start NodeJs

01

Change into the directory of the location of the node project

cd nodeProjects

Change into the directory of the location of the node project

cd nodeProjects

02

Change into the directory of the project

cd nodeProjects

open the dojo-blog in code

code dojo-blog

04

The scripts to run the react index file are in the package.json file in scripts :

You can run the following scripts command in the console

npm run start
npm run build

05

Use the following script command to open index.html in a browswer

npm run start

06

Make a change to App.js files, App.js is injected into index.js which grabs the div id="root" element and injects itself with the function App() from App.js

07

Delete uneccesary files we are not using

  • App.text.js

and

  • reportWebVitals.js

make sure to remove the import from index.js

08

If you delete anything, make sure you delete it from any scripts, like the logo.png

09

summary

The index.js script gets injected into the div id='root' element. The App() function gets put in the index.js by doing the following

root.render(
<React.StrictMode>
    <App />
</React.StrictMode>
);