2017 © Pedro Peláez
 

kohana-module kohana-hapi

HTTP API module for Kohana 3.3

image

anroots/kohana-hapi

HTTP API module for Kohana 3.3

  • Monday, April 29, 2013
  • by anroots
  • Repository
  • 0 Watchers
  • 0 Stars
  • 208 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Kohana HAPI

HyperMedia Application Programming Interface - A Kohana module to use as a framework for building HTTP APIs., (*1)

Screenshot of a HTTP response, (*2)

In development. Do not use. It is expected that the major (backwards incompatible) versions will be increased rapidly., (*3)

What it is

  • Framework for adding API support to your Kohana project
  • Unfinished
  • Rather strict than general-purpose

What it is not

  • RESTful - Well, a bit, but missing [level three of the API maturity model](http://www.crummy .com/writing/speaking/2008-QCon/act3.html)
  • Scalable and optimized - mean for one server, one client approach where client is under vendor control
  • Tested

Installation

  • Clone and enable the module. Use a git submodule, download the zip or add a Composer dependency
  • Add a route to the API controller:
<?php
Route::set(
    'api',
    'api(/<controller>(/<id>(/<action>)))'
)
    ->defaults(
    array(
        'directory'  => 'API/V1/',
        'controller' => 'About',
        'action'     => 'index'
    )
);
  • Create APPPATH/classes/Controller/API/V1/Main.php - extends Controller_HAPI
  • Create APPPATH/classes/Controller/API/V1/About.php - extends Controller_API_V1_Main
  • In the action_index, write:
<?php
$this->hapi(['about' => 'Hello, world']);
  • Make a HTTP GET query to `BASE_URL/api/v1/about

TODO

  • Remove some of the hardcoded values to support not only JSON
  • Document code, wiki, gh-pages
  • Improve architecture
  • Improve API semantics: provide meaningful error and status messages in response body
  • Work towards achieving REST

The Versions

29/04 2013

dev-develop

dev-develop https://github.com/anroots/kohana-hapi

HTTP API module for Kohana 3.3

  Sources   Download

MIT

The Requires

 

api rest http kohana kohana module

04/03 2013

dev-master

9999999-dev https://github.com/anroots/kohana-hapi

HTTP API module for Kohana 3.3

  Sources   Download

MIT

The Requires

 

api rest http kohana kohana module