I am new to web deployment and hosting but have been coding for a couple years
I currently have a backend and frontend that work separately. I was able to deploy the frontend in Firebase and have the backend containerized (Docker) then running in Google Compute Engine (GCE) and deployed on Google App Engine (GAE) with a flex environment. Both are working independently and wonderfully; locally and in their respected deployed services but now I want to have it work under my custom domain I bought from Google Domains, let it be sicko-project.com
Locally i have my backend as local:8080/api/ping and my frontend localhost:4200/ping which gets the backend data from localhost:8080/api/ping
My question is how can I have them work under my domain?
What I know.
I know that you can't have two separate web servers under one domain, I embarrassingly learned that by chatting with Google support chat as well as common sense. Tunnel vision is great!
I know that I can have both in different subdomains: frontend on www.app.sicko-project.com and www.api.sicko-project.com
How can I have my website be www.sicko-project.com/ping similar to how i use it locally.
Thanks
Also I am using MongoDB for the database
EDIT: I got thinking will i have to redirect traffic in code to sicko-project.com and get my backend and frontend talk by:
--pseudo-ish code--
backend code having somethinglike group(app.sicko-project.com/api/ping) and frontend code have get(api.sicko-project.com/api/ping)
EDIT2: add some cors middleware