An open API service indexing awesome lists of open source software.

https://github.com/getpinga/vizima

Vizima is a high-performance API micro-framework designed to help you create powerful APIs in PHP. This project is a port of the popular Mark framework to Swoole.
https://github.com/getpinga/vizima

api fast php swoole

Last synced: 9 months ago
JSON representation

Vizima is a high-performance API micro-framework designed to help you create powerful APIs in PHP. This project is a port of the popular Mark framework to Swoole.

Awesome Lists containing this project

README

          

# Vizima

[![StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)

[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)


Vizima

Vizima is a high-performance API micro-framework designed to help you create powerful APIs in PHP. This project is a port of the popular [Mark](https://github.com/passwalls/mark) framework to Swoole.

## Install

```
composer require pinga/vizima
```

## Usage

```php
# start.php

get('/', function() {
return '

Hello, world!

';
});

$app->get('/hello/{name}', function (Swoole\Http\Request $request, $name) {
return "Hello $name";
});

$app->post('/user/create', function () {
return json_encode(['code'=>0 ,'message' => 'ok']);
});

$app->start();
```

Run command ```php start.php```

Going to http://127.0.0.1:3000/hello/world will now display "Hello world".

## Benchmark

```
Thread Stats Avg Stdev Max +/- Stdev
Latency 3.07ms 4.27ms 92.46ms 92.61%
Req/Sec 2.56k 801.21 17.84k 67.79%
1221250 requests in 30.10s, 203.82MB read
Requests/sec: 40575.11
Transfer/sec: 6.77MB
```

## Support

If you have any problems, do not heasitate to open an Issue.