mirror of
https://github.com/zenstackhq/zenstack
synced 2026-05-24 10:08:55 +00:00
13 lines
491 B
TypeScript
13 lines
491 B
TypeScript
import { RPCApiHandler } from '@zenstackhq/server/api';
|
|
import { createEventHandler } from '@zenstackhq/server/nuxt';
|
|
import { db } from '~~/server/utils/db';
|
|
import { schema } from '~~/zenstack/schema';
|
|
|
|
const handler = createEventHandler({
|
|
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,
|
|
});
|
|
|
|
export default handler;
|