endpoint url change

This commit is contained in:
候学杰 2019-01-05 12:05:58 +08:00
parent a8e9a50e98
commit e98954ec60

View File

@ -21,20 +21,24 @@ class LumenServerServiceProvider extends ServiceProvider
public function boot() public function boot()
{ {
$this->app->router->group([ $this->app->router->group([
'prefix' => 'rpc'
// 'middleware' => 'rpc', // 'middleware' => 'rpc',
], function () { ], function () {
$callback = function () { $config = config('rpc.server');
$server = new JsonRpcServer();
$callback = function () use($config) {
$server = new JsonRpcServer($config);
return $server->handler(); return $server->handler();
}; };
$this->app->router->post('rpc/gateway.json', $callback); $this->app->router->post('json-rpc-v2.json', $callback);
$this->app->router->get('rpc/gateway.json', $callback); $this->app->router->get('json-rpc-v2.json', $callback);
$this->app->router->get('rpc/doc.html', function () {
$doc = new JsonRpcDoc(base_path('app/Rpc/')); // $this->app->router->get('doc.html', function () {
return $doc->render(); // $doc = new JsonRpcDoc(base_path('app/Rpc/'));
}); // return $doc->render();
// });
}); });
} }