@universal-packages/express-controllers-trpc
v1.3.0
Published
tRPC middleware for universal-express-controllers.
Readme
Express Controllers TRPC
tRPC middleware for universal-express-controllers
Install
npm install @universal-packages/express-controllers-trpc
npm install @universal-packages/express-controllersGlobal methods
initialize(options: Object)
Initialize the trpc middleware to start passing requests to trpc.
import { ExpressControllers } from '@universal-packages/express-controllers'
import { initialize } from '@universal-packages/express-controllers-trpc'
await initialize({ trpcLocation: './src/trpc.js', trpcPath: '/my-trpc' })
const app = new ExpressControllers({ port: 3000 })
await app.prepare()
await app.run()Now you can access your trpc routes at http://localhost:3000/my-trpc
Options
trpcLocationStringdefault: ./src/trpc- The location where you have exported your trpc router and a possible
createContextfunction.
- The location where you have exported your trpc router and a possible
trpcPathStringdefault: /trpc- The path where you want to access your trpc routes.
Typescript
This library is developed in TypeScript and shipped fully typed.
Contributing
The development of this library happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving this library.
