|
...
|
...
|
@@ -12,11 +12,6 @@ class SimpleServer |
|
|
|
$this->httpServer = new Server($host, $port);
|
|
|
|
}
|
|
|
|
public function router($url, $callback){
|
|
|
|
$this->httpServer->on($url, function ($request, $response) use ($callback){
|
|
|
|
$response->header("Content-Type", "text/plain");
|
|
|
|
$content = call_user_func($callback);
|
|
|
|
$response->end("Hello World\n");
|
|
|
|
});
|
|
|
|
$this->httpServer->on('Request', function (Request $request, Response $response) use ($url, $callback){
|
|
|
|
$requestInfo = [
|
|
|
|
'path' => $request->server['path_info'],
|
...
|
...
|
|