Skip to content

Commit fc3cdc9

Browse files
docs: update cloudflare workers docs (#3405)
1 parent e30cb37 commit fc3cdc9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

docs/latest/deployment/cloudflare-workers.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,21 @@ Deploy Fresh to Cloudflare Workers by following these instructions:
2020
});
2121
```
2222

23-
3. Follow further instructions provided by the cloudflare vite plugin.
23+
3. Create a `server.js` file that serves as the cloudflare worker entry file:
24+
25+
```js
26+
import server from "./_fresh/server.js";
27+
28+
export default {
29+
fetch: server.fetch,
30+
};
31+
```
32+
33+
4. Follow further instructions provided by the cloudflare vite plugin.
2434

2535
Check out the
2636
[Cloudflare Documentation](https://developers.cloudflare.com/workers/vite-plugin/)
2737
for further information.
2838

2939
> [info]: Make sure that you set the the correct entrypoint in your
30-
> `wrangler.jsonc` file. It should point to `"main": "./_fresh/server.js"`
40+
> `wrangler.jsonc` file. It should point to `"main": "./server.js"`

0 commit comments

Comments
 (0)