mirror of
https://gitlab.massbug.com/massbug/judge4c.git
synced 2025-07-04 23:51:20 +00:00
feat(appwrite): add function to create admin client with Appwrite configuration
This commit is contained in:
parent
41e21b1149
commit
448afc4dec
14
src/lib/appwrite.ts
Normal file
14
src/lib/appwrite.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { Account, Client } from "node-appwrite";
|
||||||
|
|
||||||
|
export async function createAdminClient() {
|
||||||
|
const client = new Client()
|
||||||
|
.setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT!)
|
||||||
|
.setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT!)
|
||||||
|
.setKey(process.env.NEXT_APPWRITE_KEY!);
|
||||||
|
|
||||||
|
return {
|
||||||
|
get account() {
|
||||||
|
return new Account(client);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user