From ad3073b39e2659d9328f91a18ebeecc13eb8ceee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20P=C4=99dzich?= Date: Fri, 26 May 2023 22:05:03 +0200 Subject: [PATCH] Update appwrite.ts code snippet --- .../setting-up-vue-and-appwrite-projects-for-racemash.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/content/blog/setting-up-vue-and-appwrite-projects-for-racemash.md b/src/content/blog/setting-up-vue-and-appwrite-projects-for-racemash.md index f4a3342..cd3eb68 100644 --- a/src/content/blog/setting-up-vue-and-appwrite-projects-for-racemash.md +++ b/src/content/blog/setting-up-vue-and-appwrite-projects-for-racemash.md @@ -2,7 +2,7 @@ title: setting up vue and appwrite projects for racemash description: From ESLint and Prettier configs to creating Appwrite databases and everything in between pubDate: 2023-05-23T18:48:00.556Z -lastEditDate: 2023-05-24T08:04:47.377Z +lastEditDate: 2023-05-26T20:04:45.875Z draft: false categories: - dev diary @@ -164,10 +164,10 @@ interface ImportMetaEnv { } ``` -`appwriteClient.ts` +`appwrite.ts` ```ts -import { Client } from 'appwrite'; +import { Account, Client, Databases } from 'appwrite'; const appwriteClient = new Client(); @@ -175,7 +175,8 @@ appwriteClient .setEndpoint(import.meta.env.VITE_APPWRITE_ENDPOINT) .setProject(import.meta.env.VITE_APPWRITE_PROJECT_ID); -export { appwriteClient }; +export const account = new Account(appwriteClient); +export const databases = new Databases(appwriteClient); ``` I wasn't ready to test the connection just yet, because I still had to set up auth and databse collections. Speaking of which...