Back to Prompts
Coding Assistant

Log Every Request

Great second example - see every request From the Middleware Basics AI Coding Building Block.

Prompt
Create simple middleware that logs every request that comes into my app.

Framework: [Express, Flask, Django, FastAPI, etc.]

For each request, log:
1. When it happened (timestamp)
2. What page they requested (URL/path)
3. How they requested it (GET, POST, etc.)

Keep the code simple. I just want to understand how middleware can see every request. Show me where to put this middleware so it runs on ALL requests.

I'm learning, so explain each part simply.
59 views 2 copies