feat: rebuild app using vike

This commit is contained in:
2024-02-22 12:15:04 +00:00
parent 87ef4ca1e3
commit 9777ae1676
104 changed files with 2214 additions and 2976 deletions
+10
View File
@@ -0,0 +1,10 @@
import { CreateExpressContextOptions } from "@trpc/server/adapters/express";
export const createContext = async ({
req,
res,
}: CreateExpressContextOptions) => {
return {};
};
export type Context = Awaited<ReturnType<typeof createContext>>;
+10
View File
@@ -0,0 +1,10 @@
import { createExpressMiddleware } from "@trpc/server/adapters/express";
import { appRouter } from "~/server/routers/_app";
import { createContext } from "./context";
const trpc = createExpressMiddleware({
router: appRouter,
createContext,
});
export default trpc;
+7
View File
@@ -0,0 +1,7 @@
import { initTRPC } from "@trpc/server";
import { Context } from "./context";
const t = initTRPC.context<Context>().create();
// Base router and procedure helpers
export const { router, procedure, createCallerFactory } = t;
+7
View File
@@ -0,0 +1,7 @@
import { createContext } from "./context";
import { appRouter } from "../../routers/_app";
import { createCallerFactory } from ".";
const trpcServer = createCallerFactory(appRouter)(createContext);
export default trpcServer;