Installation¶
High speed walk-through: Installation¶
You can find the scripts for the YAML
-configuration and .htaccess
below.
Step-by-step instruction¶
Install the extension
Press the Retrieve/Update button and search for the extension keynnrestapi
.Then import the extension from the repository.
OR
Search for the current version in the TYPO3 Extension Repository (TER). Download the t3x or zip version. Upload the file afterwards in the Extension Manager and activate it.
OR
Install the extension using composer on the command-line:
composer require nng/nnrestapi
Make sure the database-tables were created
In the TYPO3 backend, switch to the "Maintenance" module and click on "Analyze Database Structure". Create the database-tables for
nnrestapi
, if necessary. For more information, read here.Include the TypoScript Templates on your Root-page
Make sure, the static TypoScript configuration for "RestApi Configuration (nnrestapi)" was included on your root-page. To do so, follow the standard instructions on how to include TypoScript from extensions.
Include the YAML-Configuration
Search for your site-configuration YAML, which is usually located either under
typo3conf/sites/{name}/config.yaml
or underconfig/sites/{name}/config.yaml
.Include these two lines at the end of the configuration.
imports: - { resource: "EXT:nnrestapi/Configuration/Yaml/default.yaml" }
They take care of the basic Routing to the Api – another words: That all requests sent to
/api/...
find their way to your classes and methods.Modify the .htaccess
This step might not be necessary - it depends a lot on your hosting environment and PHP-settings. In most of our installations these two lines were necessary – otherwise we had problems with the frontend user-session / authorization.
Insert these two lines after
RewriteEngine On
:RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
Get started!
Go to the RestApi backend module and have a look!
Then head on to the Quickstart section to write your first own endpoint in less than 5 minutes!