-
Notifications
You must be signed in to change notification settings - Fork 0
Petstore Example App
Garret Premo edited this page Mar 31, 2026
·
2 revisions
The Petstore API is a lightweight Bun + SQLite server included in the apijack repo. It serves as the running example throughout this wiki. Use it to follow along with any guide.
Bun runtime is required.
curl -fsSL https://bun.sh/install | bashClone the Petstore example repo and start the server:
git clone https://github.com/Premo-Cloud/apijack-petstore-example.git
cd apijack-petstore-example
bun run startThe server runs on port 3459.
HTTP Basic Auth: username admin, password password
| Method | Path | Description |
|---|---|---|
| GET | /v3/api-docs |
OpenAPI 3.0 spec (no auth) |
| GET | /pets |
List pets (filter: ?species=dog, ?status=available) |
| POST | /pets |
Create a pet |
| GET | /pets/:id |
Get a pet by ID |
| PUT | /pets/:id |
Update a pet |
| DELETE | /pets/:id |
Delete a pet |
| POST | /pets/:id/adopt |
Adopt a pet (assign to owner) |
| GET | /owners |
List owners |
| POST | /owners |
Create an owner |
| GET | /owners/:id |
Get owner with their pets |
| PUT | /owners/:id |
Update an owner |
| DELETE | /owners/:id |
Delete an owner |
Pets: id, name, species (dog/cat/bird/fish/rabbit), age, status (available/pending/adopted), ownerId (nullable)
Owners: id, name, email
The app starts with pre-loaded data. The database is in-memory, so it resets on each restart.
Owners
| ID | Name | |
|---|---|---|
| 1 | Alice Johnson | alice@example.com |
| 2 | Bob Smith | bob@example.com |
Pets
| ID | Name | Species | Age | Status | Owner |
|---|---|---|---|---|---|
| 1 | Buddy | dog | 3 | adopted | Alice |
| 2 | Whiskers | cat | 2 | available | — |
| 3 | Goldie | fish | 1 | available | — |
| 4 | Rex | dog | 5 | adopted | Bob |
| 5 | Luna | cat | 1 | pending | — |
Verify the server is running:
curl -s -u admin:password http://localhost:3459/pets | head -20Essentials
Using a CLI
Authoring Routines
- Writing Routines
- Variables
- Output Capture
- Conditions & Assertions
- Loops
- Error Handling
- Sub-Routines & Meta-Commands
- Routine Testing
Building a CLI
- Building a CLI
- Authentication Strategies
- Session Auth
- Project Mode
- MCP Server Integration
- Code Generation Internals
Reference