Routes expose service components to public and internal users with best practices such as SSL, CDN and WAF configurations.
Each workspace declares one or more
root_domains. Static site, serverless and https components automatically get
provisioned with routes, making them accessible by public or internal users.
To deploy a static website accessible to the public at
www.example.com you can add a public component:
--- components: - type: static-public route: www.example.com
To deploy a website only accessible inside of your network, you can add an internal component:
components: - type: internal-https route: internal-api.example.com
You can deploy the same app to both public and internal users in the same service, by declaring two components.
Routes are created with best practices built in, out of the box:
If a route is public, it will also provision:
Each environment your app is deployed to gets a unique route. In your
workspace.yml schema, one environment will be
declared as your "release" environment.
Deploys to a
release environment will be top level. For example:
Deploys to other environments will have the environment added to the route. For example:
You can use `pt open app env` to open any app for any environment.