Middleware

Your task In the code box, write two middleware: requestId (sets X-Request-Id to a new UUID on every answer) and jsonOnly (answers 415 with { "error": "Send the body as JSON" } for a POST, PUT or PATCH without a JSON Content-Type). Add both with use() before routes. Then press Run my code.

Getting the editor ready