Examples

This Website

This website runs with Zack! The file-based routing for the website is very simple and looks like this:

routes/
├─ development.md
├─ doc.md
├─ examples.php
└─ index.php

And also the folder with the necessary twig views looks manageable:

views/
├─ base.html.twig
├─ examples.html.twig
└─ index.html.twig

In this example, the two Markdown files are automatically converted to HTML and output, while the PHP files are rendered and output using Twig.

Petstore OAS 3.0

As an API example, we have (more or less) implemented the endpoints of the Swagger Petstore - OpenAPI 3.0 specification.

The file-based routing for the API looks as follows:

routes/api/petstore3/
├─ pet
│  ├─ [petId]
│  │  ├─ index.delete.json
│  │  ├─ index.get.json
│  │  ├─ index.post.json
│  │  └─ uploadImage.post.json
│  ├─ findByStatus.get.json
│  ├─ findByTags.get.json
│  ├─ index.post.json
│  └─ index.put.json
├─ store
│  ├─ order
│  │  ├─ [orderId]
│  │  │  ├─ index.delete.json
│  │  │  └─ index.get.json
│  │  └─ index.post.json
│  └─ inventory.get.json
└─ user
   ├─ [username]
   │  ├─ index.delete.json
   │  ├─ index.get.json
   │  └─ index.put.json
   ├─ createWithList.post.json
   ├─ index.post.json
   ├─ login.get.json
   └─ logout.get.json

Click on the endpoints below to see the requests and responses in detail.

pet Everything about your Pets.

POST /api/petstore3/pet Add a new pet to the store.
POST /api/petstore3/pet/{petId} Updates a pet in the store with form data.
POST /api/petstore3/pet/{petId}/uploadImage Uploads an image.

store Access to Petstore orders.

POST /api/petstore3/store/order Place an order for a pet.

user Operations about user.

POST /api/petstore3/user Create user.
POST /api/petstore3/user/createWithList Creates list of users with given input string.