mirror of
https://github.com/khairul169/code-share.git
synced 2026-10-24 11:53:58 +07:00
feat: fix panel persist over server rendering, etc
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
import { CreateExpressContextOptions } from "@trpc/server/adapters/express";
|
||||
import { Request } from "express";
|
||||
|
||||
export const createContext = async ({
|
||||
req,
|
||||
res,
|
||||
}: CreateExpressContextOptions) => {
|
||||
export const createContext = async ({ req }: { req: Request }) => {
|
||||
return {};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import { createContext } from "./context";
|
||||
import { appRouter } from "../../routers/_app";
|
||||
import { createCallerFactory } from ".";
|
||||
import { PageContext } from "vike/types";
|
||||
|
||||
const trpcServer = createCallerFactory(appRouter)(createContext);
|
||||
const trpcServer = async (ctx: PageContext) => {
|
||||
const createCaller = createCallerFactory(appRouter);
|
||||
const context = await createContext({ req: ctx.req });
|
||||
return createCaller(context);
|
||||
};
|
||||
|
||||
export default trpcServer;
|
||||
|
||||
Reference in New Issue
Block a user