There is no license information available for the latest version (v1.0.4) of this package.

v1.0.4 2025-03-25 09:16 UTC

This package is not auto-updated.

Last update: 2025-03-25 09:24:44 UTC


README

Based on Apitte and Nette Framework.

API

Setup

Register Base API using ApiExtension to your Nette-based application.

# config.neon

extensions:
    api: Sabservis\Api\DI\ApiExtension

api:
    # Register middlewares
    middlewares:
        - App\Core\Api\Middleware\AuthenticationMiddleware
        - App\Core\Api\Middleware\AuthorizationMiddleware

    validator: App\Core\Api\Mapping\SymfonyValidator()
    router:
        basePath: /api # If our API is located in subdirectory /api

After that, create entrypoint to your Nette-based application. For example www/index.php looks like that.

// www/index.php

use App\Bootstrap;
use Sabservis\Api\Application\Application;

require __DIR__ . '/../vendor/autoload.php';

Bootstrap::boot()
    ->createContainer()
    ->getByType(Application::class)
    ->run();