poop00peepee123
poop00peepee123
CDCloudflare Developers
Created by poop00peepee123 on 6/16/2024 in #pages-help
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" }
]
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?
4 replies
CDCloudflare Developers
Created by poop00peepee123 on 6/4/2024 in #pages-help
Can't access Pages through wrangler dev
Previously I've only deployed my pages app to production but I'm messing around with a function and wanted to test it locally with more debugging tools. I ran 'wrangler pages dev' to try to spin it up yet when I navigate to https://localhost:8788/ in a browser I get a generic "This localhost page can’t be found" error any ideas?
4 replies
CDCloudflare Developers
Created by poop00peepee123 on 6/3/2024 in #pages-help
Pages Function seemingly not deployed to base environment
Hi all, I have a environment that's xxx.pages.dev that seems to get updated every time I run a deploy from the CLI. However, I just bought a simple function and when I run deploy with that included, it successfully deploys to the "new" environment that wrangler produces (https://a2189f60.xxx.pages.dev) but not to my base environment (xxx.pages.dev). All other changes seem to go through this flow but not the function, for some reason. When I try to navigate to my function through xxx.pages.dev/myFunction it seems to just show me the page at the root (xxx.pages.dev). Any ideas?
11 replies