# Routing & middleware

A step of the [Cloud application](https://gradus.kazet.blog/tree/cloud-application) tree on Gradus, in the Serving & compute area: HTTP, workers, scaling.

Page: https://gradus.kazet.blog/tree/cloud-application/step/routing-and-middleware

Add structured routing and shared middleware for CORS, body parsing and request logging.

Usually comes after: [Runnable service](https://gradus.kazet.blog/tree/cloud-application/step/runnable-service).

Leads to: [Background workers](https://gradus.kazet.blog/tree/cloud-application/step/background-workers), [API gateway & versioning](https://gradus.kazet.blog/tree/cloud-application/step/api-gateway).

## Prompt for your AI assistant

```
Add a structured router with route groups and shared middleware for CORS, JSON body parsing and request logging.
```

Every step of the tree: https://gradus.kazet.blog/tree/cloud-application/llms.txt
