mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
17 lines
424 B
PHP
17 lines
424 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
require 'vendor/autoload.php';
|
||
|
|
|
||
|
|
use Appwrite\Client;
|
||
|
|
use Appwrite\Services\Users;
|
||
|
|
|
||
|
|
return function ($context) {
|
||
|
|
$client = new Client();
|
||
|
|
$client
|
||
|
|
->setEndpoint(getenv('APPWRITE_FUNCTION_ENDPOINT'))
|
||
|
|
->setProject(getenv('APPWRITE_FUNCTION_PROJECT_ID'))
|
||
|
|
->setKey($context->req->headers['x-appwrite-key']);
|
||
|
|
$users = new Users($client);
|
||
|
|
return $context->res->json($users->list());
|
||
|
|
};
|