1
0
Fork 0
mirror of synced 2024-09-20 19:42:42 +12:00
appwrite/tests/resources/functions/php-scopes/index.php
2024-05-09 11:50:45 +00:00

16 lines
428 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_API_ENDPOINT'))
->setProject(getenv('APPWRITE_FUNCTION_PROJECT_ID'))
->setKey($context->req->headers['x-appwrite-key']);
$users = new Users($client);
return $context->res->json($users->list());
};