how to deploy already created project worker wrangler?

any one help me to deploy my full stack proejct with worker
5 Replies
texan
texan•2w ago
Hey Skins, do you already have a wrangler.toml, or are you configuring things from dash?
Skins
SkinsOP•2w ago
i created wrangler.json just used sample { "name": "my-worker", "main": "src/index.js", "compatibility_date": "2022-07-12", "workers_dev": false, "route": { "pattern": "example.org/", "zone_name": "example.org" }, "kv_namespaces": [ { "binding": "<MY_NAMESPACE>", "id": "<KV_ID>" } ], "env": { "staging": { "name": "my-worker-staging", "route": { "pattern": "staging.example.org/", "zone_name": "example.org" }, "kv_namespaces": [ { "binding": "<MY_NAMESPACE>", "id": "<STAGING_KV_ID>" } ] } } }
texan
texan•2w ago
Cool, yeah you can just run npx wrangler deploy and it will do the upload 🙂 add a -e staging if you want to deploy to the staging worker instead
Skins
SkinsOP•2w ago
"add a -e staging if you want to deploy to the staging worker instead" can explain more
texan
texan•2w ago
Your wrangler.json file specifies a staging environment. If you run npx wrangler deploy -e staging it will deploy my-worker-staging with the specified route and kv binding

Did you find this page helpful?