PHP code example of hi / http

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

    

hi / http example snippets




use Hi\Http\Application;
use Hi\Http\Context;

lication();

// 路由定义
$app->get('/', fn () => 'hi, framework!');

// 服务将会运行在 http://127.0.0.1:4000
$app->listen(4000);



use Hi\Http\Application;
use Hi\Http\Context;

mework!')
    ->listen(4000)
;