sahil-gulati/apibase

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

Utility for creating light weight API's

Installs: 9

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/sahil-gulati/apibase

1.0.0 2021-10-16 09:48 UTC

This package is auto-updated.

Last update: 2025-10-16 23:28:49 UTC


README

Utility for creating light weight API's

Installation

composer require sahil-gulati/apibase

Example

<?php

require_once 'vendor/autoload.php';

# Register routes
APIBase\URL\Router::registerRoutes("/api/v1", array(
    array(
        METHOD => "GET",
        ROUTE => "/payments",
        HANDLER => "helloWorld"
    )
));

# Process request
APIBase\URL\Invoker::processRequest();

function helloWorld(){
    echo json_encode(array("message" => "Hello from sahil!"));
}

Test

localhost:80/api/v1/payments