How to use .prefix
with contract first development?
#550
Answered
by
unnoq
valerii15298
asked this question in
Q&A
-
https://orpc.unnoq.com/docs/openapi/routing#route-prefixes I did not see it documented anywhere for contract first development, so not sure if it is even supported... I tried this: import { oc } from "@orpc/contract";
const usersContract = oc.prefix("/users");
// Property 'route' does not exist on type 'ContractRouterBuilder<Record<never, never>, Record<never, never>>'
const getUsersContract = usersContract.route; But it does not work: I am getting typescript error above |
Beta Was this translation helpful? Give feedback.
Answered by
unnoq
May 27, 2025
Replies: 1 comment 4 replies
-
Almost the same as the link you mentioned, just with .router after that: const userRouter = os.prefix('/users').router({
get: getUsersContract,
}) |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
valerii15298
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Almost the same as the link you mentioned, just with .router after that: