Course lesson 45 · Dev Ops & Environments
Create a specific stage deployment
The existing deployment is reorganized into an explicitly named stage environment, preparing for a separate production copy. Resource bindings move under the stage section of each Wrangler configuration, and deployment and type-generation commands must select that environment. The lesson exposes practical migration issues: Worker names change, queue consumers conflict, Vite selects environments differently, and service bindings must follow the renamed backend.
Primary source: course video 45 · Supplied English subtitles · 00:10:44.
Understand the idea
- Stage is the lower environment used to validate changes before promoting them to production.
- Shared Worker settings can remain at the top level while resource choices belong to each named environment.
- Selecting an environment affects the deployed Worker identity as well as its bindings.
- Type generation needs the selected environment to include the correct resource handles.
- The Vite build’s environment choice must agree with the intended Wrangler deployment.
What the course does
- Outline a branch-based flow in which stage changes are verified before merging to the production branch.
- Move data-service bindings and environment-specific settings into the stage environment.
- Add stage selection to its deployment and environment-type generation scripts.
- Resolve the existing queue-consumer conflict caused by the newly named stage Worker.
- Repeat environment organization for the user application, selecting stage through the Vite-related environment setting.
- Update the backend service binding and browser base host to the new stage names, then verify the application.
Watch for
- The instructor deletes earlier tutorial Workers to resolve migration conflicts; this is a disposable-course-environment action, not a general production migration recipe.
- The deployment initially fails because the queue already has a consumer.
- The frontend’s build-tool-generated configuration rejects the same deployment flag used successfully for the plain Worker.
Recall before revealing
Why does renaming the backend deployment require a frontend configuration change?
Reveal the explanation
Its service binding targets the deployed service name, which now includes the stage suffix.
Try it
List the names and settings that must agree for a stage frontend to reach its stage backend.
Check your result
You identify the selected environment, deployed backend name, service binding target, and browser base host.
Practice prompts and answer checks are added teaching material. Answer from memory first, then compare and explain any difference.
Rewatch only what you need
Open this lesson in your original course library and seek to the times below. Videos are not hosted on this site.
- 00:02:37 — Shared versus environment-specific settings
- 00:04:09 — Deployment and type-generation environment selection
- 00:05:42 — Queue consumer conflict
- 00:08:47 — Vite environment selection
Companion primary documentation: Wrangler environments. For recorded API names, commands, limits, and prices, check the version you use.