Installation

High speed walk-through: Installation

For people, who know their way around TYPO3 – no words needed, only enough coffee :)

You can find the scripts for the YAML-configuration and .htaccess below.

Step-by-step instruction

  1. Install the extension

    Press the Retrieve/Update button and search for the extension key nnrestapi.

    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
    
  2. 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.

  3. 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.

  4. Include the YAML-Configuration

    Search for your site-configuration YAML, which is usually located either under typo3conf/sites/{name}/config.yaml or under config/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.

  5. 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]
    
  6. 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!