This is a basic sense check question as i'm deploying a few new modules:
dispatch.yaml:
application: my-app
# No version required; this does routing independent of version.
dispatch:
# Default module serves the typical web resources and all static resources.
- url: "*/favicon.ico"
module: default
# Default module serves simple hostname request.
- url: "simple-sample.appspot.com/"
module: default
# Send all mobile traffic to the mobile frontend.
- url: "*/mobile/*"
module: mobile-frontend
# Send all work to the one static backend.
- url: "*/work/*"
module: static-backend
Wouldn't it be safer to put "*.com/mobile/*" instead of "*/mobile/*" ? In case other modules could use /mobile/ in their urls somewhere and accidentally get routed to mobile-frontend?
What if I have domain names other than .com e.g. .io?
Yes, it could be considered safer in the way you're looking at it.
For the additional
.io(or other) domains you can add a rule for each of those suffixes:Side note: you don't actually need to specify the rules for the
defaultmodule - all requests not matching any rules in the dispatch files are by default routed to thedefaultmodule, making such rules redundant. You can test this by making a request not matching any of yourdispatch.yamlrules and watching thedefaultmodule's logs.