noahflk / react-trpc-turbo

Boilerplate using a Turbo Monorepo with a React Vite frontend, Express.js Node backend connected by tRPC
MIT License
24 stars 1 forks source link

.env / TRPC example (VITE_API_URL) #1

Closed Awolize closed 2 months ago

Awolize commented 2 months ago

Hello,

First off, thank you for this boilerplate repo! I just wanted to add that you need to create a .env file that includes the VITE_API_URL path variable in order for the TRPC calls to work. An example of a TRPC call would also be very helpful. At least mentioning it in the readme could be enough.

.env

VITE_API_URL = "http://localhost:3000"

index.lazy.tsx

const userQuery = trpc.hello.get.useQuery({ name: 'Firstname' });
noahflk commented 2 months ago

Much needed feedback. Thank you @Awolize

Fixed in #f8359c9