1
0
Fork 0
mirror of synced 2024-07-06 07:00:56 +12:00

Move App::init to general.php

This commit is contained in:
fogelito 2024-04-11 10:28:16 +03:00
parent 99666aa34e
commit c7281af6e2
2 changed files with 10 additions and 9 deletions

View file

@ -381,15 +381,6 @@ function updateAttribute(
return $attribute;
}
App::init()
->groups(['database', 'function', 'storage', 'messaging'])
->inject('project')
->action(function (Document $project) {
if ($project->getId() === 'console') {
throw new Exception(Exception::PROJECT_RESERVED_PROJECT, 'Please check X-Appwrite-Project header');
}
});
App::init()
->groups(['api', 'database'])
->inject('request')

View file

@ -5,6 +5,7 @@ require_once __DIR__ . '/../init.php';
use Appwrite\Event\Certificate;
use Appwrite\Event\Event;
use Appwrite\Event\Usage;
use Appwrite\Extend\Exception;
use Appwrite\Extend\Exception as AppwriteException;
use Appwrite\Network\Validator\Origin;
use Appwrite\Utopia\Request;
@ -357,6 +358,15 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo
return false;
}
App::init()
->groups(['database', 'function', 'storage', 'messaging'])
->inject('project')
->action(function (Document $project) {
if ($project->getId() === 'console') {
throw new Exception(Exception::PROJECT_RESERVED_PROJECT, 'Please check X-Appwrite-Project header');
}
});
App::init()
->groups(['api', 'web'])
->inject('utopia')