djreed
djreed

Reputation: 2733

Structuring and deploying node frontend and backend to Google App Engine

I'm working on a React project with two node apps:

I had a couple questions:

What I've currently done:

Is this a good approach?

If so, the challenge I'm now facing is that my API service is deployed to a subdomain and requests from my frontend are failing. Locally I am using the proxy value to proxy requests to my backend port on localhost, but I'm not sure how to modify my app to dynamically make backend requests to the correct subdomain when in the production environment (I also think CORS comes into play).

Upvotes: 1

Views: 1216

Answers (1)

dishant makwana
dishant makwana

Reputation: 1079

You need a dispatch.yaml file. The dispatch.yaml allows you to override routing rules. You can use the dispatch.yaml to send incoming requests to a specific service (formerly known as modules) based on the path or hostname in the URL.

Upvotes: 3

Related Questions