Is it possible to configure two services on the same url in dispatch.yaml?

242 views
Skip to first unread message

Mina Demian

unread,
Nov 6, 2017, 10:14:45 AM11/6/17
to Google App Engine
Hi all,

Battling to get this to work. I have an app composed of two services - frontend in Angular, backend in Node.

dispatch:

  - url: "<frontend-app>-dot-apt-aleph-767.appspot.com/"
    service
: <frontend-app>


 
- url: "<frontend-app>-dot-apt-aleph-767.appspot.com/backend/"
    service
: <backend-app>


This is the output from `gcloud app describe`:

dispatchRules:
- domain: <frontend-app>-dot-apt-aleph-767.appspot.com
  path
: /
  service: <frontend-app>

- domain: <frontend-app>-dot-apt-aleph-767.appspot.com
  path: /
backend/*
  service: <frontend-app>

When I navigate to the url for the frontend app, it works as expected. However, I get a 404 when I go to `<frontend-app>-dot-apt-aleph-767.appspot.com/backend`.

Is it even possible to have two services on the same domain in Google App Engine?

Thanks in advance

George (Cloud Platform Support)

unread,
Nov 6, 2017, 11:33:36 AM11/6/17
to Google App Engine
It is indeed possible to have multiple logical units that can share state using the datastore or memcache. 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.The rules that you define in your dispatch file must use HTTP URL patterns that include the "." notation for separating sub-domains. URLs defined with the HTTPS "-dot-" notation are not supported. You may read more in-depth related information from the "Routing with a dispatch file" sub-chapter of the "How Requests are Routed" documentation page

Mina Demian

unread,
Nov 7, 2017, 7:57:41 AM11/7/17
to Google App Engine
thank you for your response. i've configured my dispatch file as described in the documentation. however, i still get a 404 when I try to access my backend service from the frontend url.
any ideas?

George (Cloud Platform Support)

unread,
Nov 7, 2017, 3:06:01 PM11/7/17
to Google App Engine
How do you access the back-end service? Does your app.yaml define all your modules with handlers? 

To reproduce the issue, we need a representative sample of your code, that you may send via private email, visible to me only. The message can be created from the "reply" button's drop-down menu, at the top right of the editing window. 
Reply all
Reply to author
Forward
0 new messages