2025-11-03 07:14:11 +00:00
|
|
|
import { db } from '@/lib/db';
|
|
|
|
|
import { schema } from '@/zenstack/schema';
|
|
|
|
|
import { RPCApiHandler } from '@zenstackhq/server/api';
|
|
|
|
|
import { NextRequestHandler } from '@zenstackhq/server/next';
|
|
|
|
|
|
|
|
|
|
const handler = NextRequestHandler({
|
2026-01-08 08:12:14 +00:00
|
|
|
apiHandler: new RPCApiHandler({ schema, log: ['debug', 'error'] }),
|
2025-11-03 07:14:11 +00:00
|
|
|
// fully open ZenStackClient is used here for demo purposes only, in a real application,
|
|
|
|
|
// you should use one with access policies enabled
|
|
|
|
|
getClient: () => db,
|
|
|
|
|
useAppDir: true,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export { handler as DELETE, handler as GET, handler as PATCH, handler as POST, handler as PUT };
|