zenstack/samples/nuxt/server/api/model/[...].ts

14 lines
516 B
TypeScript
Raw Permalink Normal View History

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, log: ['debug', 'error'] }),
// 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;