title: How to deploy frontend and backend with the same domain name?
body: <p>I'm not very familiar with deployment and networking as I'm primarily a frontend developer. I want to create a project with Laravel and React (separated, not integrated with blade), and deploy them to AWS. I want to use Laravel only as an API server, and I'm planning to deploy it on EC2. If I host my React app on S3, how will it be possible for me to share the same domain with the API sever running on the EC2 instance?</p>
  <p>I know that I can have separate subdomains,like <a href="http://www.example.com" rel="nofollow noreferrer">www.example.com</a> for my React app and api.example.com for my API server. However, if I want to have <a href="http://www.example.com" rel="nofollow noreferrer">www.example.com</a> for my React app and <a href="http://www.example.com/api" rel="nofollow noreferrer">www.example.com/api</a> for my API server, what options do I have? And what resources can you recommend for me to get more up to speed on this topic? Thanks!</p>