- Docker ( I tested on Docker for Mac. )
- docker-compose
- make
$ git clone this_repo
$ cd this_repo
$ make
If you do not have make command.
$ docker-compose up -d
$ cp .env.example .env
$ chmod -R a+w storage/*
$ docker-compose run composer install --prefer-dist --no-interaction
$ docker-compose exec php-fpm php artisan key:generate
$ docker-compose exec php-fpm php artisan migrate
$ docker-compose exec php-fpm php artisan db:seed
$ curl -H 'Content-Type: application/json' http://localhost:8000/api/accounts/A00001 | jq .
{
"account_number": "A00001",
"balance": 3000
}
$ curl -X PUT -d '{"destination_number":"B00001","money":100}' -H 'Content-Type: application/json' http://localhost:8000/api/accounts/A00001/transfer | jq .
{
"balance": 2900
}