Skip to content

Commit

Permalink
add test app field
Browse files Browse the repository at this point in the history
  • Loading branch information
iway1 committed Dec 22, 2022
1 parent 7dd6b1e commit f3e53e3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/test-app/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const t = initTRPC

async function createContext(opts: trpcExpress.CreateExpressContextOptions) {
const authHeader = opts.req.headers["authorization"];
console.log("Request headers: ");
console.log(authHeader);
return {
authorized: !!authHeader,
};
Expand Down Expand Up @@ -265,10 +267,7 @@ export const testRouter = t.router({
.query(({ input }) => {
return { greeting: `Hello ${input.name}!` };
}),
sayHello2: t.procedure
.meta({ /* 👉 */ description: "This shows in the panel." })
.input(z.object({ name: z.string() }))
.query(({ input }) => {
return { greeting: `Hello ${input.name}!` };
}),
nonObjectInput: t.procedure.input(z.string()).query(({ input }) => {
return `Your input was ${input}`;
}),
});

0 comments on commit f3e53e3

Please sign in to comment.