Skip to content

hakobyansen/php-routing-attributes-example

Repository files navigation

This is an example app for DEV article.

Create .env file in the root of the project with following single variable:

JSON_PLACEHOLDER_BASE_URL=https://jsonplaceholder.typicode.com

Build, run and install composer dependencies:

docker-compose up --build

Install composer dependencies

docker-compose run app composer install

Once you are up and running, you can retrieve existing user by ID or create new user using curl or another HTTP client.

# retrieve user by ID
curl -X GET --location "http://localhost:8080/users?id=10" 
   -H "Content-Type: application/json" 
   -H "Accept: application/json"

# create new user
curl -X POST --location "http://localhost:8080/users" \
    -H "Content-Type: application/json" \
    -d "{
          \"name\": \"John Smith\"
        }"

About

An example app for DEV article

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published