I have classic web application rendered on server. I want to create admin panel as single page application in React. I want to server admin panel from https://smyapp.example
You should add entry in package.json for this.
Add a key "homepage": "your-subfolder/" in your package.json All static files will be loaded from "your-subfolder"
If there is no subfolder and you need to load from same folder you need to add the path as "./" or remove the entire line which has "homepage": "xxxxxxxxxx"
"homepage": "./"
From the official docs
By default, Create React App produces a build assuming your app is hosted at the server root. To override this, specify the homepage in your package.json, for example:
"homepage": "http://mywebsite.com/relativepath",
Note: If you are using react-router@^4, you can root s using the basename prop on any .
From here and also check the official CRA docs