11import { Hono } from "hono" ;
22import type { Context } from "hono" ;
33import { getCookie , setCookie } from "hono/cookie" ;
4- import { handle } from "hono/vercel" ;
54import { SignJWT , jwtVerify } from "jose" ;
65import { Pool } from "pg" ;
76import { mustGetMutator , mustGetQuery } from "@rocicorp/zero" ;
87import { handleMutateRequest , handleQueryRequest } from "@rocicorp/zero/server" ;
98import { zeroNodePg } from "@rocicorp/zero/server/adapters/pg" ;
10- import { mutators } from "../src/mutators" ;
11- import { queries } from "../src/queries" ;
12- import { schema , type AuthData } from "../src/schema" ;
9+ import { mutators } from "../src/mutators.ts " ;
10+ import { queries } from "../src/queries.ts " ;
11+ import { schema , type AuthData } from "../src/schema.ts " ;
1312
1413export const config = {
1514 runtime : "nodejs" ,
@@ -75,12 +74,15 @@ app.get("/login", async (c) => {
7574} ) ;
7675
7776app . post ( "/zero/query" , async ( c ) => {
77+ console . log ( "query" ) ;
7878 const ctx = await getContext ( c ) ;
79+ console . log ( "ctx" , ctx ) ;
7980 const result = await handleQueryRequest (
8081 ( name , args ) => mustGetQuery ( queries , name ) . fn ( { args, ctx } ) ,
8182 schema ,
8283 c . req . raw
8384 ) ;
85+ console . log ( "result" , result ) ;
8486 return c . json ( result ) ;
8587} ) ;
8688
@@ -97,7 +99,7 @@ app.post("/zero/mutate", async (c) => {
9799 return c . json ( result ) ;
98100} ) ;
99101
100- export default handle ( app ) ;
102+ export default app ;
101103
102104function must < T > ( val : T ) {
103105 if ( ! val ) {
0 commit comments