Routing, Deployment, and Release
Routing
Routing in TVLK5 is defined in route.yml file. Each route has a matching service and optional environment modifier (dev-only, dev-and-pr, or dev-and-staging) in which the rule should be applied. The route is matched from top to bottom based on environment modifier. No modifier means that the route definition is valid in all environment including production.
Local and ASEN staging routing
In development, when you run pnpm dev in root directory, it will start the dev-proxy and forward requests based on entries inside route.yml file. This is why running pnpm dev is instant because by default it only starts API proxy.
When you visit any URL, it will then start the service that handle the URL and only that service. Staging environment is similar as it also relies on route.yml files which has been adjusted to be served through Kubernetes cluster.

Production & RC staging routing
Production environment and RC staging, however, have a different traffic forwarding logic.
All incoming requests hit our Lambda@Edge webrtr service. This service routes incoming requests based on route.yml and adds the X-TVLK-Target-Service request header. (webrtr is always kept on sync with the latest commit on the rc and release branches)
The incoming requests then hit our ALB, which routes the incoming request to the target ECS service based on the X-TVLK-Target-Service added by webrtr.