mirror of
https://github.com/zenstackhq/zenstack
synced 2026-05-24 10:08:55 +00:00
* WIP * feat: tanstack-query/react CRUD hooks implementation * fix build * addressing PR comments * update * update * migrate tests * update * fix test environment * use happy-dom instead of jsdom
14 lines
574 B
TypeScript
14 lines
574 B
TypeScript
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({
|
|
apiHandler: new RPCApiHandler({ schema }),
|
|
// 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 };
|