first project commit

This commit is contained in:
2026-05-16 12:02:15 +01:00
parent 33789b13d1
commit c013b52f59
79 changed files with 5834 additions and 0 deletions
@@ -0,0 +1,4 @@
import { handlers } from '@/lib/auth';
export const { GET, POST } = handlers;
export const runtime = 'nodejs';
@@ -0,0 +1,25 @@
import { fetchRequestHandler } from '@trpc/server/adapters/fetch';
import { appRouter, createTRPCContext } from '@repo/api';
import { resolveUser } from '@/lib/auth';
export const runtime = 'nodejs';
const handler = async (req: Request) => {
return fetchRequestHandler({
endpoint: '/api/trpc',
req,
router: appRouter,
createContext: async () => {
const user = await resolveUser();
return createTRPCContext({ user, headers: req.headers });
},
onError({ error, path }) {
if (process.env.NODE_ENV === 'development') {
// eslint-disable-next-line no-console
console.error(`[trpc] ${path ?? '<no-path>'}:`, error.message);
}
},
});
};
export { handler as GET, handler as POST };