https://github.com/zephirorb/zro
zRo is a micro framework based on workerman helps you quickly write APIs with php.
https://github.com/zephirorb/zro
microframework workerman zro
Last synced: 7 months ago
JSON representation
zRo is a micro framework based on workerman helps you quickly write APIs with php.
- Host: GitHub
- URL: https://github.com/zephirorb/zro
- Owner: ZephiroRB
- License: mit
- Created: 2020-04-30T07:26:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-19T09:47:34.000Z (over 5 years ago)
- Last Synced: 2025-06-07T23:50:47.195Z (8 months ago)
- Topics: microframework, workerman, zro
- Language: PHP
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
zRo is a micro framework based on [workerman](https://github.com/walkor/workerman) helps you quickly write APIs with php.
# Install
It's recommended that you use Composer to install zRo.
`composer require zephirorb/zro`
# Usage
index.php
```php
count = 10;
$zro->any('/', function ($request) {
return 'Hello world';
});
$zro->post('/articles/create', function ($request) {
return json_encode(['code'=>0 ,'message' => 'ok']);
});
$zro->get('/hello/{name}', function ($request, $name) {
return "Hello $name";
});
$zro->start();
```
Run command `php index.php start -d`
Going to http://127.0.0.1:3000/hello/world will now display "Hello world".
# Available commands
```
php index.php restart -d
php index.php stop
php index.php status
php index.php connections
```
# Nginx
If you would like to use Nginx as reverse proxy or load balancer for your Comet app, insert into nginx.conf these lines:
```php
http {
upstream app {
server http://localhost:port;
}
server {
listen 80;
location / {
proxy_pass http://app;
proxy_redirect off;
}
}
}
```
# License
The zRo Framework is licensed under the MIT license. See License File for more information.