Link to home
Start Free TrialLog in
Avatar of Jimbo99999
Jimbo99999Flag for United States of America

asked on

Javascript React how do I display Homepage?

Good Day Experts!

I am working on a Group project.  The front end person used React.  The homepage looks great.  But,  I am having a heck of a time trying to figure how to display the homepage from my server.js file. I am trying to do that since that is the only way I know how to from past experiences.  I am wanting to use express, models, sequelize. mysql etc.  Is there a different way I need to go about this?  When I look at the index.html file there is "nothing" in it.  Then there is a home.jsx file and a App.js file.  

Do I have to scrap the server.js file "call" the homepage a different way since React was used?  I just don't understand.

Is there a good reference piece that you think can help me out here?

Thanks,
jimbo99999
SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jimbo99999

ASKER

Hello.  Thank you for your replies.  Ok, I understand conceptually about this React thing.  I have attached a file with screen prints of what I was given from the group member working on the front end.  The last screen shot was my attempt at putting in place my models, routes, controllers and server.js file stuff.  This is how I have done it in the past with my Node apps.  <--I have a feeling this is not correct.

"When the React library loads (I assume this is in the app.js file)"...am I using the app.js file instead of the server.js?  Or do I still use server.js and have to run the App.js file to load the React library from there?

Thank you for helping,
jimbo99999
Nothing attached.

You do exactly as you would for any other HTML file. There is absolutely no difference. Once React has been compiled it is just scripts that get included in your page - as with any other HTML page.
Sorry about that.
SPs.docx
There should be a build process that you run to create a distribution from your source. Something like

ng build

Depends on your setup though.
Correction - ng is an Angular CLI command

The build command for react should be something like

npm run build

Open in new window