- Clone this repository using
git
git clone git@github.com:andhikayuana/car-gallery-api.git
- Install depdendencies using
composer
$ cd car-gallery-api
$ composer install
- Import this database on your local machine
- Setup your environment database to src/settings.php
To run this API using this command
cd public
php -S localhost:3000
Access localhost:3000
using postman or your web browser
and now you can see like this
{
"name": "Cars API",
"version": "1.0.0"
}
[GET] /cars | get all cars
[GET] /cars/{id} | get cars by id
[POST] /cars | insert cars
body [raw] :
{
"year": "2011",
"make": "honda",
"model": "mobilio"
}
[PUT] /cars/{id} | update cars
body [raw] :
{
"year": "2015",
"make": "halo",
"model": "world"
}
[DELETE] /cars/{id} | delete by id