Configure routes

The final configuration file you will need to modify in your repository is the .platform/routes.yaml file, which describes how an incoming HTTP request is going to be processed by

├── .platform
│   ├── routes.yaml
│   └── services.yaml
└── < application code >

A minimal configuration .platform/routes.yaml for all languages will look very similar:

# The routes of the project.
# Each route describes how an incoming URL is going
# to be processed by

    type: upstream
    upstream: "app:http"

    type: redirect
    to: "https://{default}/"

Configuring the routes can be done using either an absolute URL or a URL template as shown in the examples above that have the form http://www.{default}, where {default} will be substituted by either your configured domain or those automatically generated by

If you set up a domain of, the route configuration http://www.{default} will be resolved to Your production (master) environment’s routes will be configured according to these rules, but so will each development environment that you activate.

Each route can then be configured with the following properties:

  • type:
    • upstream: serves the application. Takes the form upstream: <application name>:http, using the application name set in your
    • redirect: configures redirects from http://{default} to your application.
  • cache: controls caching behavior of the route.
  • redirects: controls redirect rules associated with the route.

In the next step, you will be able to see how leverages environment variables to make connecting your application to its services simple.