new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

tRPC · all subjects

router definition and procedures

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

tRPC server-side procedure calls and testing

Call procedures from server code and write integration tests. Refer to server-side-calls skill for patterns.

Minimal tRPC server setup with standalone HTTP server

Initialize tRPC with initTRPC.create(), define a router with t.router() containing procedures like t.procedure.input().query(), and host it using createHTTPServer from @trpc/server/adapters/standalone. Call server.listen(port) to start. Export AppRouter type for client use.

tRPC skill router decision tree for server setup

To define a tRPC backend, start with initTRPC.create(), define routers with t.router(), define procedures with t.procedure, set up context, export AppRouter type. Use server-setup skill for full details.

next-big-router example demonstrates DX with large routers

The next-big-router example shows the developer experience when working with a large tRPC router in tRPC v10. It includes a postinstall script that generates 700 procedures by default, which can be customized by modifying the scripts/codegen.ts file.

next-big-router example setup instructions

To set up the next-big-router example, clone the repository from git@github.com:trpc/examples-v10-next-big-router.git, navigate to the directory, run yarn to install dependencies, optionally open the code editor with code ., and start the development server with yarn dev.

Give your agent this brain