iescarro/flake
最新稳定版本:v0.0.6
Composer 安装命令:
composer require iescarro/flake
包简介
A minimal PHP microframework inspired by Express.js
README 文档
README
🧊 Flake
A minimal PHP microframework inspired by Express.js — simple, fast, and easy to extend.
🚀 Installation
Before you start, make sure you have PHP ≥ 8.1 and Composer installed.
mkdir myapp
cd myapp
composer init
composer require iescarro/flake
🧩 Quick Start
Create an index.php file:
<?php require __DIR__ . '/vendor/autoload.php'; use Flake\Router; use Flake\App; Router::get('/', function ($req, $res) { $res->send('Hello, world!'); }); App::run();
Then start the local server:
php -S localhost:8000
Open your browser at 👉 http://localhost:8000
You should see “Hello, world!”
⚙️ Features
- 🚦 Express-style routing — Simple Router::get(), Router::post(), etc.
- 💡 Minimal core — Focused on speed, readability, and flexibility.
- 🧱 Extensible — Add your own middleware, handlers, or modules.
- 🧰 No configuration required — Works out of the box.
🧠 Example Routes
Router::get('/hello/:name', function ($req, $res) { $name = $req->params['name'] ?? 'Guest'; $res->send("Hello, $name!"); }); Router::post('/data', function ($req, $res) { $res->json(['received' => $req->body]); });
📚 Learn More
Visit the Wiki → Home for deeper examples.
- Routing and middleware
- JSON responses
- Request and response objects
- Error handling and custom middleware
🧑💻 Contributing
Contributions, issues, and feature requests are welcome!
Feel free to open a discussion or pull request .
📜 License
Released under the MIT License
Copyright © 2025 FlakePHP .
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-12
