How to use installed middlewares in tRPC?
There are a lot of middlewares from npm that I am using like helmet, session and so on.
What is the recommended way adding these middlewares in my tRPC app?
can you show a simple example?
10 Replies
Those are specific to Express and don’t work anywhere else without significant customisation
If you’re using tRPC inside of Express, you could still use them
But most Express middleware doesn’t really make sense in this context
wanted to avoid that, to use major parts that create-t3-app already configured for me
is there any way to get a tRPC inside Express via create-t3-app?
no
I know the express adapter but if am using it, I have to configure all of that by my own 😦
the first thing on that page is an example project you can clone
sure, but the problem is that then I have to setup next with the server 😦
it looks like we have to use a custom next.js server to get next.js and express with trpc
hmm
Maybe make a monorepo structure like t3-turbo?
If you’re using express you dont need next - use Vite
I don't need next?
not getting why 🙂
Next.js is awesome and allows you to do many things that I am familiar with.