restler/application

Application boiler-plate for Luracast Restler, an api first micro framework

dev-master 2021-06-11 13:50 UTC

This package is auto-updated.

Last update: 2024-02-13 21:26:18 UTC


README

Restler

Basic Restler Application

Minimalistic api server boilerplate for Luracast Restler

Restler is an api first microframework that offers better web api by design. Every branch in this repository contains different application templates to suit your needs.

Basic App provides the bare minimum to get started with restler development

Installation

Make sure PHP 5.5 or above (use the latest version of PHP for better performance) is available on your server

Composer is used to manage the dependencies. If you don't already have composer installed, we recommend installing it globally

Install Composer

Instructions to install composer globally are available in getcomposer.org

Install Basic Restler Application

You can run the following command on your terminal window to install the app

composer create-project restler/application=dev-basic {app_name}

Replace {app_name} with the name of your application.

It will create a new folder and place all the needed files to get started.

Alternatively, since this is a template repository, you can simply generate your own repository from it!

What's in it?

Basic is a minimalistic app templates for api development. It has a sample api class called Home that has the following success message for the api root.

It is advisable to use namespace for the api classes for avoiding name conflicts, here we are using App as the namespace

{
  "success": {
    "code": 200,
    "message": "Restler is up and running!"
  }
}

On your development machine, you can run the development server by running the composer serve on the project root. This will run the php development server at port 8000 on localhost by default. If you need to run change that you can edit your composer.json accordingly.

This project also comes with swagger ui for testing and documenting the api. You can access that using the following url

http://localhost:8000/explorer

Next Steps

There is only public api, you may want to add an auth class and add some protected api