https://github.com/notrab/dumbo Skip to content Navigation Menu Toggle navigation Sign in * Product + GitHub Copilot Write better code with AI + Security Find and fix vulnerabilities + Actions Automate any workflow + Codespaces Instant dev environments + Issues Plan and track work + Code Review Manage code changes + Discussions Collaborate outside of code + Code Search Find more, search less Explore + All features + Documentation + GitHub Skills + Blog * Solutions By company size + Enterprises + Small and medium teams + Startups By use case + DevSecOps + DevOps + CI/CD + View all use cases By industry + Healthcare + Financial services + Manufacturing + Government + View all industries View all solutions * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} notrab / dumbo Public * Notifications You must be signed in to change notification settings * Fork 19 * Star 257 A lightweight, friendly PHP framework for HTTP. License MIT license 257 stars 19 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 4 * Pull requests 5 * Actions * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Security * Insights notrab/dumbo main BranchesTags [ ] Go to file Code Folders and files Name Name Last commit message Last commit date Latest commit History 117 Commits .github .github examples examples src src tests tests .gitattributes .gitattributes .gitignore .gitignore LICENSE LICENSE README.md README.md composer.json composer.json composer.lock composer.lock dumbo.jpeg dumbo.jpeg phpunit.xml phpunit.xml renovate.json renovate.json View all files Repository files navigation * README * MIT license Dumbo Dumbo A lightweight, friendly PHP framework for HTTP -- Inspired by Hono. Discord Contributors Total downloads Examples Features * Lightweight and fast * Middleware support * [?] Flexible routing with parameters * Built-in security features (CSRF, JWT) * Cookie management * Date helpers * Request ID for tracing * Static file serving * Basic and Bearer authentication * Logging support * [?] HTTP caching * CORS support * Environment-based configuration Install composer require notrab/dumbo Quickstart Here's a basic example of how it works! use(function ($context, $next) { $context->set('message', 'Hello from middleware!'); return $next($context); }); $app->get('/', function ($context) { return $context->json([ 'message' => $context->get('message'), 'timestamp' => time() ]); }); $app->get('/users/:id', function ($context) { $id = $context->req->param('id'); return $context->json(['userId' => $id]); }); $app->post('/users', function ($context) { $body = $context->req->body(); return $context->json($body, 201); }); $app->run(); See the examples directory for more quickstarts. License Dumbo is open-sourced software licensed under the MIT license. Contributors Contributors Documentation Routing get('/users', function($context) { /* ... */ }); $app->post('/users', function($context) { /* ... */ }); $app->put('/users/:id', function($context) { /* ... */ }); $app->delete('/users/:id', function($context) { /* ... */ }); Params get('/users/:id', function($context) { $id = $context->req->param('id'); return $context->json(['id' => $id]); }); Nested get('/nested', function($context) { return $context->text('This is a nested route'); }); $app->route('/prefix', $nestedApp); Context get('/', function($context) { $pathname = $context->req->pathname(); $routePath = $context->req->routePath(); $queryParam = $context->req->query('param'); $tags = $context->req->queries('tags'); $body = $context->req->body(); $userAgent = $context->req->header('User-Agent'); }); Response json(['key' => 'value']); return $context->text('Hello, World!'); return $context->html('