PHPackages                             tnapf/api-skeleton - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tnapf/api-skeleton

AbandonedArchivedProject[API Development](/categories/api)

tnapf/api-skeleton
==================

API Skeleton

v0.5.2(2y ago)0231MITPHPPHP ^8.1

Since Jun 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/tnapf/ApiSkeleton)[ Packagist](https://packagist.org/packages/tnapf/api-skeleton)[ RSS](/packages/tnapf-api-skeleton/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (6)Versions (8)Used By (0)

Tnapf/ApiSkeleton
=================

[](#tnapfapiskeleton)

Setup
=====

[](#setup)

`composer create-project tnapf/api-skeleton`

Bootstrapping
=============

[](#bootstrapping)

Just create a new file inside `Bootstrap` and then require it in `Bootstrap/requires.php`

Routing
=======

[](#routing)

Creating an endpoint
--------------------

[](#creating-an-endpoint)

First create a class that extends `Tnapf\Router\Interfaces\ControllerInterface` inside `App\Controllers` and add the `#[Route]` attribute to the class.

By default, each URI is prefixed with `/api` so the route below can be access by `/api/ping`. You can change this by setting the `API_PREFIX` constant in `Bootstrap/environment.php`.

```
