How to write dispatch.yaml when having three services in APP ENGINE in GCP

Viewed 274

I have three services in three different folders,

app.yaml: (default service) (https://cool-adviser-307212.oa.r.appspot.com/)(https://abanoub-ayoub.com/)

runtime: nodejs16
handlers: 
- url: /
  static_files: build/index.html
  upload: build/index.html
- url: /
  static_dir: build

ui-challenge.yaml: (https://ui-challenge-dot-cool-adviser-307212.oa.r.appspot.com/)

  runtime: nodejs16
  service: ui-challenge
  handlers:
  - url: /
    static_files: build/index.html
    upload: build/index.html
  - url: /(.*)$
    static_files: build/\1
    upload: build/(.*)

test-service.yaml: (https://test-service-dot-cool-adviser-307212.oa.r.appspot.com/)

  runtime: nodejs16
  service: test-service
  handlers:
  - url: /
    static_files: build/index.html
    upload: build/index.html
  - url: /(.*)$
    static_files: build/\1
    upload: build/(.*)

and in the root folder, I have the dispatch.yaml

dispatch:
- url: "abanoub-ayoub.com/"
  service: default
- url: "*/ui-challenge"
  service: ui-challenge
- url: "*/test"
  service: test-service

but when I navigate to (https://abanoub-ayoub.com/ui-challenge) or (https://abanoub-ayoub.com/task) I get 404 error but I need to be able to navigate to these services.

UPDATE

Dispatch routes

Thank you!

1 Answers

You can use app engine settings for domain setup for your website from the GCP app engine console, you can also create subdomain records to redirect to a particular app engine service

example,

Ref: https://cloud.google.com/appengine/docs/standard/python3/mapping-custom-domains

dispatch:
- url: "simple-sample.uc.r.appspot.com/"
  service: default
- url: "*/ui-challenge/"
  service: ui-challenge
- url: "*/test/"
  service: test-service
Related