Jimbo99999
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.
ASKER
Sorry about that.
SPs.docx
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.
ng build
Depends on your setup though.
Correction - ng is an Angular CLI command
The build command for react should be something like
The build command for react should be something like
npm run build
ASKER
"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