mmurto
mmurto
Explore posts from servers
TTCTheo's Typesafe Cult
Created by mmurto on 6/13/2023 in #questions
Split tRPC to two endpoints on lambda and edge with Next
Is it possible/are there some examples of splitting the tRPC endpoint into two endpoints? My initial experiments a while back encountered some problems with trying to use nested withTRPCs. I'd like to have most of my routers on edge, but some don't work there, so need to leave them to lambdas.
2 replies
TTCTheo's Typesafe Cult
Created by mmurto on 4/29/2023 in #questions
tRPC with part on NextJS Lambdas and part on Edge
How should I go with splitting tRPC to have some functions execute on serverless/lambdas and some on edge functions? I tried creating two separate routers with nested withTRPCs, but it didn't work.
2 replies
TTCTheo's Typesafe Cult
Created by mmurto on 4/11/2023 in #questions
Handle trailing slash in NextJS API routes?
I'm trying to create an integration to Fibery through NextJS's API routes, but Fibery's integration engine seems to send one request to api/integration/ (trailing slash) and some to api/integration/schema etc, which I can't make work with the API dir. 😄 Any way to force index.ts in API route to handle both the trailing slash and without?
3 replies
TTCTheo's Typesafe Cult
Created by mmurto on 3/24/2023 in #questions
`import` and `require` in the same file?
I'm trying to use https://github.com/luin/ioredis and https://github.com/rse/tika-server/tree/master in the same project. When trying to build a Docker image out of the project, I can't seem to get it working as ioredis needs to be imported and tika-server required. What is that interaction about? Any clues how to get this working or what I may have set up wrong?
2 replies
TTCTheo's Typesafe Cult
Created by mmurto on 3/19/2023 in #questions
`onSuccess` is typed correctly as `data: ReturnItem` for one mutation but as `data: any` for another
onSuccess is typed correctly as data: ReturnItem for one mutation but as data: any for another, any ideas why? I see no apparent reason.
2 replies
TTCTheo's Typesafe Cult
Created by mmurto on 3/13/2023 in #questions
How to get context type of protectedProcedure?
I want to keep my logic outside of the routes by using functions and just calling them in the router. Is there a way to get the type of the context with the procedures applied, i.e., I want to get types ProtectedProcedureContext and PublicProcedureContext to use as input types for a function. How to?
5 replies
TTCTheo's Typesafe Cult
Created by mmurto on 2/20/2023 in #questions
How to redirect from login page with trpc's SSR enabled?
Any simple solutions for redirecting unauthenticated users to /login and authenticated users from /login to / with trpc's SSR enabled, i.e., without the use of getServerSideProps?
3 replies