Reputation: 4871
With GCP giving you endless options of how to "best" host a Node.JS web application (frontend/backend) I'm struggling to decide which way to go. I'm looking for an easy way to deploy my app (using Git Actions) and scale it. We are also looking at an open source app here, so I'm trying to be as cheap as possible...
From what I can see best practice would be to serve all my static assets (frontend) from a cloud storage bucket (cdn) and my backend from an app engine. What I'm not so sure about is where to point my custom domain at. I would expect the index.html to be served from my bucket, but if I point my domain at the app engine the requests would still go through my app which is what I want to avoid if I want to reduce load against my app engine (to not have to run too many instances). Pointing my domain at my bucket feels wrong as well. Is everyone just hosting index.html from their app engine anyway and just serve other assets from a bucket?
I might be thinking in circles here. Any help very much appreciated!
Upvotes: 1
Views: 348
Reputation: 1709
You have to use two domains:
app.yourdomain.com
pointing to the bucket with your front filesapi.youtdomain.com
pointing to app engine with your backend node.js filesUpvotes: 2