api.php 774 B

12345678910111213141516171819202122232425
  1. <?php
  2. use App\Http\Controllers\ProtobufController;
  3. use Illuminate\Http\Request;
  4. use Illuminate\Support\Facades\Route;
  5. /*
  6. |--------------------------------------------------------------------------
  7. | API Routes
  8. |--------------------------------------------------------------------------
  9. |
  10. | Here is where you can register API routes for your application. These
  11. | routes are loaded by the RouteServiceProvider and all of them will
  12. | be assigned to the "api" middleware group. Make something great!
  13. |
  14. */
  15. Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
  16. return $request->user();
  17. });
  18. // Protobuf 请求处理路由
  19. Route::post('/protobuf', [ProtobufController::class, 'handle']);
  20. Route::post('/demo', [ProtobufController::class, 'handle']);