I had to run a nodejs app with express framework to run my react app using:
const express = require('express');
const path = require('path');
const app = express();
app.use(express.static(path.join(__dirname, 'build')));
app.get('/', function(req, res) {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
app.listen(9000);
console.log('server running at 9000');
Why? shouldnt the browser just run it when we build a react app application? Any explonation why we need nodejs server here to run the react app!
UPDATE: Also in my package.json I have a property proxy: "api endpoint" but when running from this the requests are made to http://localhost:3000/api/graphql instead of for ex: dev.someserver.com/api/graphql