I've setup json-server
and runs successfully on port-3000
then run npm start
it runs on other port 3001
.
But I want to run both concurrently. I tried with Concurrently but didn't work.
When I execute this command :
$ concurrently "npm start" "json-server --watch ./topPanelData.json"
Error message:
Resolved issue with these steps:
Create json-server.json
with the following key to run a server on a different port.
{
"port": 4000
}
Update start script in package.json
"start": "concurrently \"react-scripts start\" \"json-server ./topPanelData.json\""
simply run $ npm start
It'll concurrently execute both on the different port
json-server: http://localhost:4000/topPanelData
React app: http://localhost:3000/