Vlatko
Vlatko
TTCTheo's Typesafe Cult
Created by Vlatko on 1/17/2024 in #questions
What library do you guys use for API's?
Last time I made an API I did it with express In the meantime I've used Next.js, but now I am looking for a library specifically for API's I've seen Fastify, but am not exactly sure on what is the current standard for developing an API and what libraries are in use Has Theo had any thoughts on this matter?
6 replies
TTCTheo's Typesafe Cult
Created by Vlatko on 1/12/2023 in #questions
How to extend trpc's default error codes?
I need to add more error codes to make error processing on the front-end easier. I tried adding a trpc.d.ts in the types folder.
import { type TRPCError } from '@trpc/server';

declare module '@trpc/server' {
interface TRPCError {
code: 'TRIPS/SLUG_IN_USE';
}
}
import { type TRPCError } from '@trpc/server';

declare module '@trpc/server' {
interface TRPCError {
code: 'TRIPS/SLUG_IN_USE';
}
}
But it ain't working. How do you usually go about this?
1 replies