This seems to be more about your code than the dispatch.yaml
file that is roting to service-b. For example, I deployed two services, service 1:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Service 1'
if __name__ == '__main__':
app.run(host='127.0.0.1', port=8080, debug=True)
And service 2:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Service 2'
if __name__ == '__main__':
app.run(host='127.0.0.1', port=8080, debug=True)
With the following dispatch.yaml
:
dispatch:
- url: "domain.com/app2/"
service: app2
- url: "domain.com/*"
service: default
If I try to access to domain.com/app2/
it shows NOT FOUND
error message. If I change the routing in service 2 from @app.route('/')
to @app.route('/app2')
it works like a charm.
I think that your dispatch.yaml
redirects to your service-a
but the code inside that service redirects to domain.com
.
BTW, if inside your services all your .yaml
files are named app.yaml
GAE for an unknown reason redirect to the default service so it's better to name every .yaml
as the service it handles.