I have a chat widget built with React.
The button to open the widget looks like this:
I ran npm run build, which produced the build folder.
The build folder looks like this:
I copied the build folder to a FastAPI server and changed the name of the main javascript and main css to this:
I serve the files with these FastAPI routes:
In the HTML where I want to embed the widget (the host website), I put a link tag and a script tag to pull the main js and css from the FastAPI server.
I do npm run start on the host website and get this:
The brain PNG is not found. Looking in the network tab, I see this:
It’s looking for the brain image at http://localhost:3001/static/media/brain.05079b7891cefa47d585.png
What’s the proper way of embedding a React build folder to an existing React website? I tried looking in the docs but no luck.