I have a Laravel PHP application that functions as an API accessed by an Angular single-page app. Currently, the Angular app is situated within the public folder, but I aim to separate it so I can deploy it through Amazon CloudFront.
I came across this article on hosting static websites on CloudFront, which covers the basics. However, I haven't found any information regarding accessing an API using a CDN-served site.
I want to maintain three distinct environments - development, staging, and production - each with its own Elastic Beanstalk instances and databases. Ideally, the addresses for these would be dev.blah.com, staging.blah.com, and blah.com respectively, ensuring that each version of the Angular app interfaces correctly with the backend systems.
Is there a way to deploy the Angular app similar to how I deploy to Elastic Beanstalk, such as using "git push" commands?
Can I configure the environment so that I don't have to manually update the API endpoints in the Angular app for each environment? For example, will the dev version automatically access dev.blah.com/get/user/1, while the staging version accesses staging.blah.com/get/user/1? Do I need to take specific steps to enable this functionality, or will it happen seamlessly?
Are all of these goals achievable? I'm not looking for detailed instructions, just a general overview of the process and some guidance on where I can learn more about implementing these solutions independently since my initial searches haven't yielded much information.