@veloxts/router
v0.4.3
Published
Procedure definitions with tRPC and REST routing for VeloxTS framework
Downloads
1,549
Maintainers
Readme
@veloxts/router
Pre-Alpha Notice: This framework is in early development (v0.4.x). APIs are subject to change. Not recommended for production use.
What is this?
Procedure-based routing package for the VeloxTS Framework, with hybrid tRPC and REST adapters for type-safe APIs.
Part of @veloxts/velox
This package is part of the VeloxTS Framework. For the complete framework experience, install:
npm install @veloxts/veloxVisit @veloxts/velox for the complete framework documentation.
Standalone Installation
npm install @veloxts/router @veloxts/validationDocumentation
For detailed documentation, usage examples, and API reference, see GUIDE.md.
Quick Example
import { procedure, defineProcedures } from '@veloxts/router';
import { z } from '@veloxts/validation';
export const userProcedures = defineProcedures('users', {
getUser: procedure()
.input(z.object({ id: z.string().uuid() }))
.output(UserSchema)
.query(async ({ input, ctx }) => {
return ctx.db.user.findUnique({ where: { id: input.id } });
}),
});Learn More
License
MIT
