Skip to content

Commit 40b494a

Browse files
committed
docs(solid-start): start-basic-cloudflare example
1 parent 2fd8de5 commit 40b494a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+9927
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
.DS_Store
3+
.cache
4+
.env
5+
dist
6+
.wrangler
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/public
2+
pnpm-lock.yaml
3+
routeTree.gen.ts
4+
worker-configuration.d.ts
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"files.watcherExclude": {
3+
"**/routeTree.gen.ts": true
4+
},
5+
"search.exclude": {
6+
"**/routeTree.gen.ts": true
7+
},
8+
"files.readonlyInclude": {
9+
"**/routeTree.gen.ts": true
10+
}
11+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Start Basic Cloudflare
2+
3+
## Getting Started
4+
5+
### Install the dependencies
6+
7+
```bash
8+
pnpm i
9+
```
10+
11+
### Start the development server
12+
13+
```bash
14+
pnpm dev
15+
```
16+
17+
### Build for Production
18+
19+
```bash
20+
pnpm build
21+
```
22+
23+
### Preview the production build
24+
25+
```bash
26+
pnpm preview
27+
```
28+
29+
### Deploy to Cloudflare
30+
31+
```sh
32+
pnpm run deploy
33+
```
34+
35+
## Accessing bindings
36+
37+
You can access Cloudflare bindings in server functions by using importable `env`:
38+
39+
```ts
40+
import { env } from 'cloudflare:workers'
41+
```
42+
43+
See `src/routes/index.tsx` for an example.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "tanstack-solid-start-example-basic-cloudflare",
3+
"private": true,
4+
"sideEffects": false,
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite dev",
8+
"build": "vite build && tsc --noEmit",
9+
"preview": "vite preview",
10+
"deploy": "npm run build && wrangler deploy",
11+
"cf-typegen": "wrangler types",
12+
"postinstall": "npm run cf-typegen"
13+
},
14+
"dependencies": {
15+
"@tanstack/solid-router": "^1.133.20",
16+
"@tanstack/solid-router-devtools": "^1.133.20",
17+
"@tanstack/solid-start": "^1.133.20",
18+
"solid-js": "^1.9.5"
19+
},
20+
"devDependencies": {
21+
"@cloudflare/vite-plugin": "^1.13.7",
22+
"@types/node": "^22.5.4",
23+
"vite-plugin-solid": "^2.11.9",
24+
"autoprefixer": "^10.4.20",
25+
"postcss": "^8.5.1",
26+
"tailwindcss": "^3.4.17",
27+
"typescript": "^5.7.2",
28+
"vite": "^7.1.7",
29+
"vite-tsconfig-paths": "^5.1.4",
30+
"wrangler": "^4.40.2"
31+
}
32+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}
29.3 KB
Loading
107 KB
Loading
26.6 KB
Loading
832 Bytes
Loading

0 commit comments

Comments
 (0)