Demo project.
Fork demo repo: https://github.com/juretopolak/trpc-nuxt
git clone https://github.com/[username]/trpc-nuxt
cd trpc-nuxt
yarn install
- Login in CloudFlare > Workers & Pages
- Create aplication > Pages
- Connect to Git > Select new
[trpc-nuxt]
repo - Begin setup and deploy with settings:
Build command: npx nuxi generate
Build output directory: /dist
Root directory: /
Build comments on pull requests: Enabled
- Page > Settings > Environment variables > Add variables
YARN_ENABLE_IMMUTABLE_INSTALLS = false
- Workers & Pages > D1
- Create database (Dashboard)
- Copy Database name and ID to
wrangler.toml
- Workers & Pages > [trpc-nuxt] > Settings
- Functions > D1 database bindings
- Edit bindings > Add variable
DB = trpc-nuxt
wrangler login
wrangler d1 migrations apply DB --local
wrangler pages dev --local --d1=DB -- yarn dev
Push and check new deployment in CloudFlare.
git push