2024-05-06 23:27:28 +12:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require 'vendor/autoload.php';
|
|
|
|
|
|
|
|
use Appwrite\Client;
|
|
|
|
use Appwrite\Services\Users;
|
|
|
|
|
|
|
|
return function ($context) {
|
|
|
|
$client = new Client();
|
|
|
|
$client
|
2024-05-09 23:50:45 +12:00
|
|
|
->setEndpoint(getenv('APPWRITE_FUNCTION_API_ENDPOINT'))
|
2024-05-06 23:27:28 +12:00
|
|
|
->setProject(getenv('APPWRITE_FUNCTION_PROJECT_ID'))
|
|
|
|
->setKey($context->req->headers['x-appwrite-key']);
|
|
|
|
$users = new Users($client);
|
|
|
|
return $context->res->json($users->list());
|
|
|
|
};
|