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.
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.
store Access to Petstore orders.
user Operations about user.