Imam Ali Mustofa b0e5454f6c
feat: dumbo body limit (#42)
* 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>
2024-09-04 14:34:47 +01:00

568 B

Body Limit Example

This example demonstrates how to use a body limit middleware in Dumbo.

Running the Example

  1. Install dependencies:

    composer install
    
  2. Start the server:

    composer start
    
  3. 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"