mirror of
https://github.com/notrab/dumbo.git
synced 2025-01-17 14:18:14 +01:00
b0e5454f6c
* refactor: add missing response interface * feat: add body limit helper * refactor: add http error handler * update example * format readme --------- Co-authored-by: Jamie Barton <jamie@notrab.dev>
Body Limit Example
This example demonstrates how to use a body limit middleware in Dumbo.
Running the Example
-
Install dependencies:
composer install
-
Start the server:
composer start
-
Access the route:
Upload file less than 1MB (Success)
curl -X POST http://localhost:8000/upload -F "file=@/path/to/your/less-than-1MB.file"
Upload file larger than 1MB (Error)
curl -X POST http://localhost:8000/upload -F "file=@/path/to/your/file-larger-than-1MB.file"