Nothing to see here yet. Move along.
Might require:
$ export DATABASE_URL="postgres://localhost/raffler"
To recreate db with sqlx-cli installed:
$ sqlx database drop
$ sqlx database create
$ sqlx migrate run
To build:
$ cargo build
To build and run:
$ cargo run
Useful commands for testing service/API locally.
$ curl -X POST http://localhost:8000/v1/locations -H 'Content-Type: application/json' -d '{"name":"Spola Tilten"}'
$ curl http://localhost:8000/v1/locations
$ curl -X DELETE http://localhost:8000/v1/locations/1
$ curl http://localhost:8000/v1/locations/1/games
$ curl -X POST http://localhost:8000/v1/locations/1/games -H 'Content-Type: application/json' -d '{"name":"Attack From Mars", "abbreviation": "AFM"}'
$ curl http://localhost:8000/v1/locations/1/games/1
$ curl -X PUT http://localhost:8000/v1/locations/1/games/1 -H 'Content-Type: application/json' -d '{"name":"Attack From Lars", "abbreviation": "AFL"}'
$ curl -X DELETE http://localhost:8000/v1/locations/1/games/1
curl -X POST http://localhost:8000/v1/locations/1/games/1/disable
curl -X POST http://localhost:8000/v1/locations/1/games/1/enable
curl -X POST http://localhost:8000/v1/locations/1/games/1/notes -H 'Content-Type: application/json' -d '{"note":"Autoplunger is infested with cows"}'
curl -X DELETE http://localhost:8000/v1/locations/1/games/1/notes/1
curl -X POST http://localhost:8000/v1/locations/1/games/1/reservations
curl -X POST http://localhost:8000/v1/locations/1/games/reservations
curl -X DELETE http://localhost:8000/v1/locations/1/games/1/reservations