gander / symfony-api-products

Code quality example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

API Products

Install

composer install

Setup

php bin/console doctrine:database:create
php bin/console doctrine:migrations:migrate

Preview

Linux with symfony cli

symfony server:start
curl --request POST \
  --url https://127.0.0.1:8000/api/products \
  --header 'content-type: application/json' \
  --data '{"name": "Foo Bar","price": "123.45"}'

Linux with docker:

docker run \
  --rm \
  --name symfony-rest-api \
  --volume ${PWD}:/www/api.localhost \
  --publish 80:80 \
    gander/dev:7.3
curl --request POST \
  --url http://api.localhost/api/products \
  --header 'content-type: application/json' \
  --data '{"name": "Lorem ipsum","price": "333.33"}'

About

Code quality example

License:MIT License


Languages

Language:PHP 85.8%Language:Shell 14.2%