Skip to content

morotijani/rest-api-php

Repository files navigation

php rest api

Build a Simple REST API in PHP

This repo demonstrates how to create a basic REST API in core PHP and Implement JSON Web Tokens (JWTs).

Prerequisites: PHP, Composer, MySQL, JWTs

Webservers

MAMP,

XAMPP, etc.

.htaccess file

The .htaccess file in the API folder contains directives for URL rewriting and setting environment variables for HTTP authorization.

.env file

The .env file in the project contains sensitive information such as database credentials and secret keys.

NB: users should ensure that the SECRET_KEY used in their projects is unique and secure.

Getting Started

Clone this project using the following commands:

git clone git@github.com:morotijani/rest-api-php.git

cd rest-api-php

composer install

Configuration

Step 1: Accessing PHPMyAdmin

Step 2: Creating the Database

Step 3: Importing the SQL File api.sample.sql

Step 4: Verifying the Import

Step 5: Fill the details in the .env file.

NB: Get complete and genuine verion here https://github.com/morotijani/truss ... i just did not want to delete this repo becuase people have started and already using it.

About

Build a Simple REST API in PHP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published