I'm quite new to AWS and web development so please bear me if my questions look silly.
- I have an Express service deployed via AWS codestar. the service address is myservice.ap-southeast-2.elasticbeanstalk.com
- A react app is deployed on S3 bucket.
My question is, how can I access (like make ajax call) to Express service inside React app in production enviroment? Just append any ajax call with the service address?
The s3 bucket React app is in was created by AWS codestar, does that mean the React and Express are on the same machine? I mean if they are on same machine the ajax call will be faster, right?
Another option is, since Codestar instantiated an EC2, I can deploy the React into the EC2. So that Express on EC2 serves all API requests but for static files and index.html Express directly returns the deployed React assets.
Anyone knows which solution is better?