4

I want to map notification.api.example.co.uk to a specific app engine service called notification-api

I've added a custom domain on app engine called api.example.com successfully, so was hoping the following dispatch.yaml would be sufficient:

dispatch:
  - url: "notification.api.example.co.uk/*"
    service: notification-api

I was hoping, therefore, any request, for example, a POST to notification.api.example.co.uk/test-api would route the request to service and render a response, but it doesn't reach the backend at all.

Is there something wrong in this routing, the docs are quite confusing?

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
John Mike
  • 1,895
  • 3
  • 17
  • 26
  • Is the request reaching any of your services (`default` most likely)? Did you actually map `notification.api.example.co.uk` to your app/service? – Dan Cornilescu Oct 05 '18 at 02:52
  • Note that multi-level domains can be tricky, see possibly related: https://stackoverflow.com/a/51576595/4495081 – Dan Cornilescu Oct 05 '18 at 02:54
  • @DanCornilescu the dispatch.yaml above produces the mapping of the domain to the service. – John Mike Oct 05 '18 at 08:59
  • It routes the request to your service, yes, but only **if** the request reaches your app. But without mapping the domain to your app how would GAE know the request is for your app? – Dan Cornilescu Oct 05 '18 at 09:26
  • I see, so I've added the custom domain already via AE as shown here: https://imgur.com/HBb9GKJ – John Mike Oct 05 '18 at 10:35

1 Answers1

0

You need to map a wild card subdomain to your app engine. We need to know that everything for api.example.co.uk goes to your app in order to route notifications.api.example.co.uk to you.

Ying Li
  • 2,500
  • 2
  • 13
  • 37
  • I've added the custom domain already via AE as shown here: imgur.com/HBb9GKJ – John Mike Oct 08 '18 at 10:49
  • They are not wild card setups. If you use an online DNS checker, are you able to resolve notifications.api.domain.com to Google servers? – Ying Li Oct 11 '18 at 21:37