PHP code example of pinga / vizima

1. Go to this page and download the library: Download pinga/vizima library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pinga / vizima example snippets


# start.php



\App('0.0.0.0', 8080);

$app->get('/', function() {
    return '<h1>Hello, world!</h1>';
});

$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();
 start.php