Application for managing tours
podman, make, rust, cargo, libpq
Rust
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$ export PATH=$PATH:~/.cargo/bin
Podman
Using brew:
$ brew install podman
libpq
libpq
is the client library for PostgreSQL
Installation using brew.
$ brew install libpq
make run
- Get JWT token
TOKEN=$(curl -s --request POST --data '{"user": "test", "password": "prueba123"}' http://127.0.0.1:8000/login | jq -r '.token')
- Add a venue using an authenticated user
$ curl -X POST -H "Authorization: Bearer $TOKEN" \
-H 'Content-type: application/json' \
-d @api_data/new_venue.json http://127.0.0.1:8000/venues/add
- List venues
$ curl http://127.0.0.1:8000/venues
- Get a venue
$ curl http://127.0.0.1:8000/venues/af20c605-c8e2-4c33-8311-2ff4b77991aa
- Delete a venues
$ curl -H "Authorization: Bearer $TOKEN" -X DELETE \
http://127.0.0.1:8000/venues/af20c605-c8e2-4c33-8311-2ff4b77991aa
- Get a static file
Static files are located in the www/static
and are served by the /public
API endpoint.
If you wish to serve a text, html, image, css or any static item just copy it to the www/static
directory.
$ curl http://127.0.0.1:8000/public/test.txt
``