https://github.com/prest/docs
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/prest/docs
- Owner: prest
- Created: 2023-11-15T17:47:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-11-05T17:26:08.000Z (7 months ago)
- Last Synced: 2025-11-05T19:36:06.393Z (7 months ago)
- Size: 85.9 KB
- Stars: 1
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README (1).md
Awesome Lists containing this project
README
# Start with Docker
> _To simplify the process of bringing up the test environment we will use `docker-compose`_
```sh
# Download docker compose file
wget https://raw.githubusercontent.com/prest/prest/main/docker-compose-prod.yml -O docker-compose.yml
# Up (run) PostgreSQL and prestd
docker-compose up
# Run data migration to create user structure for access (JWT)
docker-compose exec prest prestd migrate up auth
# Create user and password for API access (via JWT)
## user: prest
## pass: prest
docker-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-compose exec postgres psql -d prest -U prest -c "select * from prest_users"
# Generate JWT Token with user and password created
curl -i -X POST http://127.0.0.1:3000/auth -H "Content-Type: application/json" -d '{"username": "prest", "password": "prest"}'
# Access endpoint using JWT Token
curl -i -X GET http://127.0.0.1:3000/prest/public/prest_users -H "Accept: application/json" -H "Authorization: Bearer {TOKEN}"
```
### Supported Operating System
* Linux
* macOS
* Windows
* BSD