TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

18 lines
424 B

<?php
function main()
{
$http = new Swoole\Http\Server('127.0.0.1', 9501);
$http->on('request', function ($request, $response) {
try {
$response->header('Content-Type', 'text/plain');
$response->end('Hello World');
} catch (Exception $e) {
$response->status(500);
$response->end('error: ' . $e->getMessage());
}
});
$http->start();
}