mirror of
https://github.com/ArthurDanjou/trpc-nuxt.git
synced 2026-01-27 02:10:35 +01:00
update readme
This commit is contained in:
@@ -1,20 +1,11 @@
|
||||
# Nuxt 3 Minimal Starter
|
||||
|
||||
Look at the [nuxt 3 documentation](https://v3.nuxtjs.org) to learn more.
|
||||
# dev playground
|
||||
|
||||
## Setup
|
||||
|
||||
Make sure to install the dependencies:
|
||||
|
||||
```bash
|
||||
# yarn
|
||||
yarn install
|
||||
|
||||
# npm
|
||||
npm install
|
||||
|
||||
# pnpm
|
||||
pnpm install --shamefully-hoist
|
||||
pnpm install
|
||||
```
|
||||
|
||||
## Development Server
|
||||
@@ -22,7 +13,7 @@ pnpm install --shamefully-hoist
|
||||
Start the development server on http://localhost:3000
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
## Production
|
||||
@@ -30,13 +21,11 @@ npm run dev
|
||||
Build the application for production:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
pnpm build
|
||||
```
|
||||
|
||||
Locally preview production build:
|
||||
|
||||
```bash
|
||||
npm run preview
|
||||
pnpm preview
|
||||
```
|
||||
|
||||
Checkout the [deployment documentation](https://v3.nuxtjs.org/docs/deployment) for more information.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as trpc from '@trpc/server'
|
||||
import { z } from 'zod'
|
||||
import type { CompatibilityEvent } from 'h3'
|
||||
|
||||
export const router = trpc
|
||||
.router()
|
||||
@@ -14,10 +15,12 @@ export const router = trpc
|
||||
})
|
||||
|
||||
// optional
|
||||
export const createContext = () => {
|
||||
// ...
|
||||
export const createContext = (event: CompatibilityEvent) => {
|
||||
return {
|
||||
/** context data */
|
||||
user: {
|
||||
id: 69,
|
||||
name: 'robert',
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user