mirror of
https://github.com/notrab/dumbo.git
synced 2025-01-17 22:28:25 +01:00
b558a2b1ef
* refactor: add missing response interface * feat(compress): adding compress helper * Apply suggestions from code review Co-authored-by: Jamie Barton <jamie@notrab.dev> * refactor: add brotli compress suggestion * revert brotli for now --------- Co-authored-by: Jamie Barton <jamie@notrab.dev>
22 lines
390 B
PHP
22 lines
390 B
PHP
<?php
|
|
|
|
require "vendor/autoload.php";
|
|
|
|
use Dumbo\Dumbo;
|
|
use Dumbo\Helpers\Compress;
|
|
|
|
$app = new Dumbo();
|
|
|
|
$app->use(
|
|
Compress::compress([
|
|
"threshold" => 1024, // Minimum size to compress (bytes)
|
|
"encoding" => "gzip", // Preferred encoding (gzip or deflate)
|
|
])
|
|
);
|
|
|
|
$app->get("/", function ($c) {
|
|
return $c->json(["message" => "Hello, Dumbo!"]);
|
|
});
|
|
|
|
$app->run();
|