PHP code example of caendesilva / pikoserve

1. Go to this page and download the library: Download caendesilva/pikoserve 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/ */

    

caendesilva / pikoserve example snippets


 

// Include the Piko class
ur code should go in here
class Main extends App
{
    public function handle(): Response
    {
        return new Response(200, 'Hello World!');
    }
}

// Boot the Piko application with the Main class
Piko::boot(new Main());

Piko::boot(new Main, function () {
    file_put_contents('server.log',
        'Server started at ' . date('Y-m-d H:i:s') . PHP_EOL,
        FILE_APPEND);
});