Skip to content

A simplified way of semi-automating your Codeigniter backend/api(RESTful)

Notifications You must be signed in to change notification settings

Mwangangi/ci-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ci-rest

This is a simplified php rest-server created by extending Codeigniter core classes. I have used to for several of my projects and thought it would be of help to someone looking for a quick way to get up and running with a fully RESTful API.

Setup

Installing

Clone the project to your projects folder.

git clone https://github.com/Mwangangi/ci-rest.git

cd into the cloned folder

Rename the following files(they are inside application/config folder) as follows:

database-sample.php file to database.php

config-sample.php file to config.php

Edit the files to suit your environment setup and you're set to go!

Usage

As you like

e.g This request will fetch all customer records

GET http://ci-rest.test/api/customer

This request will fetch all customer with customer_id 3

GET http://ci-rest.test/api/customer/3

This request will create a new customer record

POST http://ci-rest.test/api/customer

This request will edit customer with customer_id 8 with new details

PUT http://ci-rest.test/api/customer/8

This request will delete customer with customer_id 6

DELETE http://ci-rest.test/api/customer/6

Note

  • All data interchange format is JSON.

Releases

No releases published

Packages

No packages published