Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 1.2 KB

README.md

File metadata and controls

66 lines (47 loc) · 1.2 KB

Play / ZIO integration

This project shows ZIO integration in a playframework application.

Run the project

sbt ~run 

Apis

List users

curl -XGET http://localhost:9000/users

Create a user

curl -XPOST http://localhost:9000/users -H 'Content-Type: application/json' -d '
    {
        "email": "[email protected]", 
        "name": "Ragnar Lodbrock",
        "birthDate": "1981-04-01"
    }' | jq

Validation error :

curl -XPOST http://localhost:9000/users -H 'Content-Type: application/json' -d '
    {
        "email": "[email protected]", 
        "name": "Ragnar Lodbrock",
        "birthDate": "1981-04-01", 
        "drivingLicenceDate": "1995-04-01"
    }' | jq

Update a user

curl -XPUT http://localhost:9000/users/[email protected] -H 'Content-Type: application/json' -d '
    {
        "email": "[email protected]", 
        "name": "Ragnar Lodbrock",
        "birthDate": "1981-04-01"
    }' | jq

Delete a user

curl -XDELETE http://localhost:9000/users/[email protected] --include

get a user

curl -XGET http://localhost:9000/users/[email protected]