era269 / movies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use

  1. init project
git clone https://github.com/era269/movies.git
cd movies
docker-compose up
  1. run tests
docker exec -it movies_php_1 bin/console doctrine:fixtures:load --env=test
docker exec -it movies_php_1 bin/phpunit
  1. servce cmmands
docker exec -it movies_php_1 doctrine:database:drop
docker exec -it movies_php_1 doctrine:database:create
docker exec -it movies_php_1 bin/console doctrine:migrations:migrate
docker exec -it movies_php_1 bin/console doctrine:fixtures:load 
  1. add movie:
docker exec -it movies_php_1 bin/console doctrine:fixtures:load
curl -k --location --request POST 'https://localhost/api/v1/movies' \
--header 'Authorization: Basic dGVzdEBlbWFpbC5jb206MQ==' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "The Titanic",
    "casts":[
        "DiCaprio",
        "Kate Winslet"
    ],
    "release_date": "18-01-1998",
    "director": "James Cameron",
    "ratings": {
        "imdb": 7.8,
        "rotten_tomatto": 8.2
    }
}'
  1. get movie
curl -k --location --request GET 'https://localhost/api/v1/movies/The%20Titanic' \
--header 'Authorization: Basic dGVzdEBlbWFpbC5jb206MQ==' \
  1. get movies
curl -k --location --request GET 'https://localhost/api/v1/movies' \
--header 'Authorization: Basic dGVzdEBlbWFpbC5jb206MQ=='

About

License:MIT License


Languages

Language:PHP 88.9%Language:Shell 5.7%Language:Dockerfile 5.4%