From 8a77a71a9ddcc559c217f929f80db8fd0faeb92a Mon Sep 17 00:00:00 2001 From: Dominik Strasser Date: Mon, 28 Oct 2024 14:33:22 +0100 Subject: [PATCH] chore: update readme --- README.md | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ea0ebbb..67b439e 100644 --- a/README.md +++ b/README.md @@ -78,26 +78,34 @@ export default { After setting up the module you can use the `dcupl` instance in your Nuxt application: ```vue + ``` -Or in an API Endpoint: +Or in an API Endpoint (`server/api/test.ts`): ```ts +import { useDcuplServerInstance } from "#dcupl"; + export default defineEventHandler(async (event) => { - const dcupl = await useDcuplServerInstance(event) + const dcupl = await useDcuplServerInstance(event); - const articleList = dcupl.lists.create({ modelKey: 'Article' }) - articleList.catalog.query.applyOptions({ count: 10 }) - return articleList.catalog.query.execute() -}) + const articleList = dcupl.lists.create({ modelKey: "Article" }); + articleList.catalog.query.applyOptions({ count: 10 }); + return articleList.catalog.query.execute(); +}); ``` ## Reload dcupl Server Session