Defining different Environments in wrangler.toml in Pages app

First Cloudflare project. I've been deploying a Pages app to a dev environment but want to configure/deploy to a Prod environment which will be a domain I have registered at Cloudflare. I have a function that performs a KV transaction so I wanted to configure the KV binding through a wrangler.toml file. Not sure exactly how it could end up working with routes but just to try something I wrote this in teh wrangler.toml file:

 name = "uvuli"
pages_build_output_dir = "./dist"

route = "https://uvuli-esketit.pages.dev/*"
vars = { ENVIRONMENT = "dev" }

kv_namespaces = [
  { binding = "EMAIL_LIST", id = "a16974f824054fb7b2457f7d13c5bfa5" }
]


[env.production]
vars = { ENVIRONMENT = "production" }
routes = [
  "uvuli.app/*",
]
kv_namespaces = [
  { binding = "EMAIL_LIST", id = "583b076b601d4dc49e13d8ddf47a574e" }
] 


though when I try to deploy this, I get an error saying that Pages doesn't support route in its wrangler.toml file. So kind of a two part question...am I even configuring the environments in the correct way and if so, how do I define the environments?
Was this page helpful?