Skip to content

Commit

Permalink
Update README with usage example (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
duffn authored Jan 27, 2025
1 parent fa5575e commit 483f685
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,27 @@ docker compose run --rm app bundle exec rake users:create

- Enter your desired email, username, and password.

## Authentication and requests

- Hello world.

```
curl http://localhost:3000/api/v1/hello | jq .
```

- Authenticate and authenticated request.

```
# Authenticate with the test user.
token=$(curl -XPOST \
-H "Content-Type:application/json" \
-d '{"username":"grape_user","password":"grape_user1"}' \
http://localhost:3000/api/login | jq -r '.token')
curl -H "Authorization: Bearer ${token}" \
http://localhost:3000/api/v1/widget | jq .
```

## Tests

- Run linting and tests.
Expand Down

0 comments on commit 483f685

Please sign in to comment.