2017 © Pedro Peláez
 

library microrest

Silex Provider that generates REST API from a RAML description file

image

marmelab/microrest

Silex Provider that generates REST API from a RAML description file

  • Thursday, October 1, 2015
  • by jeromemacias
  • Repository
  • 31 Watchers
  • 190 Stars
  • 299 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 24 Forks
  • 8 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

archived Archived Repository
This code is no longer maintained. Feel free to fork it, but use it at your own risks.

Marmelab Microrest

Microrest is a Silex provider to setting up a REST API on top of a relational database, based on a YAML (RAML) configuration file., (*1)

Check out the launch post., (*2)

What is RAML ?

RESTful API Modeling Language (RAML) is a simple and succinct way of describing practically-RESTful APIs. It encourages reuse, enables discovery and pattern-sharing, and aims for merit-based emergence of best practices., (*3)

You can easily set up a RAML file from API Designer., (*4)

Installation

To install microrest.php library, run the command below and you will get the latest version:, (*5)

composer require marmelab/microrest "~1.0@dev"

Enable ServiceController, Doctrine and Microrest service providers in your application:, (*6)

$app->register(new Silex\Provider\ServiceControllerServiceProvider());
$app->register(new Silex\Provider\DoctrineServiceProvider(), array(
    'db.options' => array(
        'driver'   => 'pdo_sqlite',
        'path'     => __DIR__.'/app.db',
    ),
));
$app->register(new Marmelab\Microrest\MicrorestServiceProvider(), array(
    'microrest.config_file' => __DIR__ . '/api.raml',
));

You need to give the path to the RAML file describing your API. You can find an example into the tests/fixtures directory., (*7)

Then, browse your new API REST on the url defined in the baseUrl configuration of your RAML api file., (*8)

Tests

Run the tests suite with the following commands:, (*9)

make install
make test

Demo

You can find a complete demo application in examples/ng-admin. You just need 2 commands to install and run it:, (*10)

make install-demo
make run-demo

Play with the Silex demo API at the url: http://localhost:8888/api, (*11)

Explore the API using ng-admin backend administration at the url: http://localhost:8888/admin, (*12)

License

microrest.php is licensed under the MIT License, courtesy of marmelab., (*13)

The Versions

01/10 2015

dev-doc_generator

dev-doc_generator

Silex Provider that generates REST API from a RAML description file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jérôme Macias
by alexis

27/09 2015

dev-stackphp

dev-stackphp

Silex Provider that generates REST API from a RAML description file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jérôme Macias
by alexis

25/09 2015

dev-master

9999999-dev

Silex Provider that generates REST API from a RAML description file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jérôme Macias
by alexis