diff --git a/src/flextype/bootstrap.php b/src/flextype/bootstrap.php index 39b3bce3..7765d0fe 100755 --- a/src/flextype/bootstrap.php +++ b/src/flextype/bootstrap.php @@ -118,17 +118,6 @@ flextype('session')->setOptions(flextype('registry')->get('flextype.settings.ses */ flextype('session')->start(); -/** - * Include API ENDPOINTS - */ -include_once ROOT_DIR . '/src/flextype/Endpoints/Utils/errors.php'; -include_once ROOT_DIR . '/src/flextype/Endpoints/Utils/access.php'; -include_once ROOT_DIR . '/src/flextype/Endpoints/entries.php'; -include_once ROOT_DIR . '/src/flextype/Endpoints/registry.php'; -include_once ROOT_DIR . '/src/flextype/Endpoints/files.php'; -include_once ROOT_DIR . '/src/flextype/Endpoints/folders.php'; -include_once ROOT_DIR . '/src/flextype/Endpoints/images.php'; - /** * Set internal encoding */ @@ -180,6 +169,19 @@ foreach ($entryFields as $fieldName => $field) { */ flextype('plugins')->init(); +/** + * Include API ENDPOINTS + */ +if (flextype()->isApiRequest()) { + include_once ROOT_DIR . '/src/flextype/Endpoints/Utils/errors.php'; + include_once ROOT_DIR . '/src/flextype/Endpoints/Utils/access.php'; + include_once ROOT_DIR . '/src/flextype/Endpoints/entries.php'; + include_once ROOT_DIR . '/src/flextype/Endpoints/registry.php'; + include_once ROOT_DIR . '/src/flextype/Endpoints/files.php'; + include_once ROOT_DIR . '/src/flextype/Endpoints/folders.php'; + include_once ROOT_DIR . '/src/flextype/Endpoints/images.php'; +} + /** * Enable lazy CORS *