You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/workers/framework-guides/web-apps/redwoodsdk.mdx
+52-8Lines changed: 52 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ sidebar:
5
5
order: 6
6
6
head: []
7
7
tags: ["full-stack"]
8
-
description: Create an RedwoodSDK application and deploy it to Cloudflare Workers with Workers Assets.
8
+
description: Create a RedwoodSDK application and deploy it to Cloudflare Workers.
9
9
---
10
10
11
11
import {
@@ -15,42 +15,86 @@ import {
15
15
Render,
16
16
PackageManagers,
17
17
Steps,
18
+
TabItem,
19
+
Tabs,
18
20
} from"~/components";
19
21
20
22
In this guide, you will create a new [RedwoodSDK](https://rwsdk.com/) application and deploy it to Cloudflare Workers.
21
23
22
-
RedwoodSDK is a composable framework for building server-side web apps on Cloudflare. It starts as a Vite plugin that unlocks SSR, React Server Components, Server Functions, and realtime capabilities.
24
+
RedwoodSDK is a framework for building server-side web applications on Cloudflare. It is a Vite plugin that provides SSR, React Server Components, Server Functions, and realtime capabilities.
23
25
24
26
## Deploy a new RedwoodSDK application on Workers
25
27
26
28
<Steps>
27
29
1.**Create a new project.**
28
30
29
-
Run the following command, replacing `<project-name>` with your desired project name:
31
+
Run the following command, replacing `my-project-name` with your desired project name:
Run the following command in the project directory to start a local development server. RedwoodSDK is just a plugin for Vite, so you can use the same dev workflow as any other Vite project:
48
+
Run the following command in the project directory to start a local development server. RedwoodSDK is a Vite plugin, so you can use the same development workflow as any other Vite project:
47
49
<PackageManagerstype="run"args={"dev"} />
48
50
49
-
5.**Deploy your project.**
51
+
Access the development server in your browser at `http://localhost:5173`, where you should see "Hello, World!" displayed on the page.
52
+
53
+
5.**Add your first route.**
54
+
55
+
The entry point of your application is `src/worker.tsx`. Open that file in your editor.
56
+
57
+
You will see the `defineApp` function, which handles requests by returning responses to the client:
Navigate to `http://localhost:5173/ping` to see "Pong!" displayed on the page.
88
+
89
+
Routes can return JSX directly. RedwoodSDK has support for React Server Components, which renders JSX on the server and sends HTML to the client.
90
+
91
+
6.**Deploy your project.**
50
92
51
93
You can deploy your project to a `*.workers.dev` subdomain or a [Custom Domain](/workers/configuration/routing/custom-domains/), either from your local machine or from any CI/CD system, including [Cloudflare Workers CI/CD](/workers/ci-cd/builds/).
52
94
53
95
Use the following command to build and deploy. If you are using CI, make sure to update your [deploy command](/workers/ci-cd/builds/configuration/#build-settings) configuration accordingly.
54
96
<PackageManagerstype="run"args={"release"} />
55
97
98
+
The first time you run the command it might fail and ask you to create a workers.dev subdomain. Go to the dashboard and open the Workers menu. Opening the Workers landing page for the first time will create a workers.dev subdomain automatically.
0 commit comments