2017 © Pedro Peláez
 

library emoji

A Slim Framework skeleton application for rapid development

image

demola/emoji

A Slim Framework skeleton application for rapid development

  • Friday, May 6, 2016
  • by andela-araimi
  • Repository
  • 2 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Emoji REST API

Coverage Status Build Status Scrutinizer Code Quality

This is a simple RESTFul API rendering emoji service to users. It was built with PHP and implements the Slim framework and JSON web token (JWT) for user authentication., (*1)

Installation

To install this package, PHP 5.5+ and Composer are required, (*2)

$ composer require demola/emoji, (*3)


Usage


To use this package, You need to set your environment variables. Define your database parameters in your .env file, (*4)

driver = mysql
host = 127.0.0.1
port = port
username = [Your username]  
password = [Your password] 
database  = [Your database]

Finally, boot-up the API service with PHP's Built-in web server:, (*5)

`$ php -S localhost:8000 -t public`

All examples are shown in POSTMAN., (*6)


Various Endpoints with their functionality


  • POST /auth/register Create a new user
  • POST /auth/login Logs a user in
  • GET /auth/logout Logs a user out
  • GET /emojis List all the created emojis.
  • GET /emojis/{id} Gets a single emoji
  • POST /emojis Create a new emoji
  • PUT /emojis/{id} Updates an emoji
  • PATCH /emojis/{id} Partially updates an emoji
  • DELETE /emojis/{id} Deletes a single emoji

Endpoints with access token

  • GET /auth/logout Logs a user out
  • POST /emojis Create a new emoji
  • PUT /emojis/{id} Updates an emoji
  • PATCH /emojis/{id} Partially updates an emoji
  • DELETE /emojis/{id} Deletes a single emoji

Endpoints without access token

  • POST /auth/register create a new user
  • POST /auth/login Logs a user in
  • GET /emojis List all the created emojis
  • GET /emojis/{id} Gets a single emoji

Registration


To manage emojis, you'd need to register as a user. The /auth/register route handles user registration., (*7)

You can register a user using POSTMAN like so:, (*8)

User Registration, (*9)


Login


To make use of routes that requires token authentication, you need to get a token. The /auth/login route handles token generation for users. You can get token like so:, (*10)

User Login, (*11)

You can now use the returned token to make other requests to restricted routes., (*12)

Get all emojis


To get all emojis, send a GET request to /emojis route like so:, (*13)

Get All Emojis, (*14)

Get an emoji


To get an emoji, send a GET request to /emojis/{id of emoji} route like so:, (*15)

Get Emoji, (*16)

Create an emoji


To create an emoji, send a POST request, with your authentication token, to /emojis route with emoji's information like so:, (*17)

Create Emoji, (*18)

Update an emoji


To update an emoji, send a PUT or PATCH request, with your authentication token, to /emojis/{id of emoji} route with the information you want to update like so:, (*19)

for put

Update Emoji, (*20)

for patch

Update Emoji, (*21)

Note: You can only update an Emoji you created personally., (*22)

Delete an emoji


To delete an emoji, send a DELETE request, with your authentication token, to /emojis/{id of emoji} route like so:, (*23)

Delete Emoji, (*24)

Note: You can only delete an Emoji you created personally., (*25)

Testing


Run the following command in the Emoji directory:, (*26)

~ phpunit

Change log


Please check out CHANGELOG file for information on what has changed recently., (*27)

Contributing


Please check out CONTRIBUTING file for detailed contribution guidelines., (*28)

Security


If you discover any issue, kindly contact ademola.raimi@andela.com, (*29)

Credits


Emoji REST API is maintained by Raimi Ademola., (*30)

License


Emoji REST API is released under the MIT Licence. See the bundled LICENSE file for more details., (*31)

The Versions

06/05 2016

dev-master

9999999-dev https://github.com/andela-araimi/Emoji-REST-API.git

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

The Development Requires

by Raimi Ademola

rest psr7 microframework router

10/04 2016

dev-analysis-Xpeb3o

dev-analysis-Xpeb3o https://github.com/andela-araimi/Emoji-REST-API.git

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

The Development Requires

by Raimi Ademola

rest psr7 microframework router

10/04 2016

dev-backup

dev-backup https://github.com/andela-araimi/Emoji-REST-API.git

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

The Development Requires

by Raimi Ademola

rest psr7 microframework router

10/04 2016

dev-analysis-q5ZpJl

dev-analysis-q5ZpJl https://github.com/andela-araimi/Emoji-REST-API.git

A Slim Framework skeleton application for rapid development

  Sources   Download

MIT

The Requires

 

The Development Requires

by Raimi Ademola

rest psr7 microframework router