Skip to content

gabrielkrneiro/RestAPI_Lumen

Repository files navigation

RestAPI in Lumen Micro-Framework

Facilitador: Gabriel M. Carneiro
E-mail: [email protected]


The Case

A book store hire your team to build a system that control the books. Each book belongs to just an author, although an author could have created more than a book. Your task is build a RestAPI that deliver this data. The communication pattern have to be JSON.

Requirements

How to install

  • Within the folder who will store the project, type git clone https://github.com/GabrielCarneiroDeveloper/RestAPI_Lumen.git
  • In project's root, run composer install
  • Rename .env.example to .env set the database info in this file.
  • In project's root yet, run the commands php artisan key:generate
  • In order to create author and book table, in project's root run php artisan migrate
  • In order to populate author and book table with test datas, in project's root run php artisan db:seed
  • to run RestAPI, in project's root use the command php artisan serve
  • to test it access http://localhost:8000/api/author

Getting all authors

About the project

  • Aiming show how to improve project's security, has been deployed an Auth0 Token Authentication, to use it just uncomment the middleware in route/web.php. The token is in token.txt stores in project's root.

  • Just for convention, the routes makes use of api words in it. For example: http://localhost:8000/api/author instead just http://localhost:8000/author

  • There's an incompatibility issue in use Lumen or Laravel with php 7.2+, so to this project make use of Php 7.1+

I hope you enjoy the project, and if you liked it please starred it. Any question or doubts, you can send me an e-email. Thanks in advance.

About

A simple example how to use Lumen to build a RestAPI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages