作者 karlet

feat:删除多余东西

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