1# Cloudflare Website service bindings
2
3One stack runs nine Websites together, each behind its own Gateway Worker:
4SvelteKit, Nuxt, Next.js HMR, Next.js preview, Octane, Astro, Waku, Vocs, and Vinext.
5The small apps live in `apps/`, with independent dependencies and build directories.
6
7Each Website has `workersDev: false` and caching enabled. Its uncached Gateway
8forwards requests with `env.WEBSITE.fetch(request)`. The stack outputs each pair's
9`websiteUrl` and `gatewayUrl`; the Website URL is only available in local dev.
10Local ports are allocated automatically. State is stored locally.
11
12## Commands
13
14From this directory:
15
16```sh
17vpr dev # start all nine Websites and Gateways together
18vpr deploy # deploy the complete stack
19vpr destroy # tear down the stack
20vpr test # run the standard dev and deployed integration tests
21```
22
23This example is included in the repository's normal `vpr test:examples` run.
24It uses the same Cloudflare authentication/profile setup as the other examples.
25
26## Tests
27
28`test/dev.test.ts` starts the whole stack once with `Test.make({ dev: true })`.
29It checks every Website directly and then through its Gateway's service binding.
30`test/integ.test.ts` deploys the whole stack and checks each Gateway against its
31private Website. Both suites destroy their stack after testing.
32
33The dev tests guard against [#1796](https://github.com/alchemy-run/alchemy/issues/1796):
34all nine Gateways must reach their private Websites through local service bindings
35and return 200 with the expected page content.