To simplify the process of bringing up the test environment we will use docker-compose
# Download docker compose filewgethttps://raw.githubusercontent.com/prest/prest/main/docker-compose-prod.yml-Odocker-compose.yml# Up (run) PostgreSQL and prestddocker-composeup# Run data migration to create user structure for access (JWT)docker-composeexecprestprestdmigrateupauth# Create user and password for API access (via JWT)## user: prest## pass: prestdocker-compose exec postgres psql -d prest -U prest -c "INSERT INTO prest_users (name, username, password) VALUES ('pREST Full Name', 'prest', MD5('prest'))"
# Check if the user was created successfully (by doing a select on the table)docker-composeexecpostgrespsql-dprest-Uprest-c"select * from prest_users"# Generate JWT Token with user and password createdcurl -i -X POST http://127.0.0.1:3000/auth -H "Content-Type: application/json" -d '{"username": "prest", "password": "prest"}'
# Access endpoint using JWT Tokencurl -i -X GET http://127.0.0.1:3000/prest/public/prest_users -H "Accept: application/json" -H "Authorization: Bearer {TOKEN}"