From e98954ec604ead253621069ae0fd3e0e0a3c121a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=80=99=E5=AD=A6=E6=9D=B0?= Date: Sat, 5 Jan 2019 12:05:58 +0800 Subject: [PATCH] endpoint url change --- src/Providers/LumenServerServiceProvider.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Providers/LumenServerServiceProvider.php b/src/Providers/LumenServerServiceProvider.php index 0b5a47d..dfb2091 100644 --- a/src/Providers/LumenServerServiceProvider.php +++ b/src/Providers/LumenServerServiceProvider.php @@ -21,20 +21,24 @@ class LumenServerServiceProvider extends ServiceProvider public function boot() { $this->app->router->group([ + 'prefix' => 'rpc' // 'middleware' => 'rpc', ], function () { - $callback = function () { - $server = new JsonRpcServer(); + $config = config('rpc.server'); + + $callback = function () use($config) { + $server = new JsonRpcServer($config); return $server->handler(); }; - $this->app->router->post('rpc/gateway.json', $callback); - $this->app->router->get('rpc/gateway.json', $callback); - $this->app->router->get('rpc/doc.html', function () { - $doc = new JsonRpcDoc(base_path('app/Rpc/')); - return $doc->render(); - }); + $this->app->router->post('json-rpc-v2.json', $callback); + $this->app->router->get('json-rpc-v2.json', $callback); + +// $this->app->router->get('doc.html', function () { +// $doc = new JsonRpcDoc(base_path('app/Rpc/')); +// return $doc->render(); +// }); }); }