Jump to content

lemgrago

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About lemgrago

  • Rank
    Starter

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Has anyone here done multi-level endpoints (e.g. /api/firstlevel/secondlevel)? I thought the $routes variable in Routes.php would end up looking like: $routes = [ ['OPTIONS', 'test', RestApiHelper::class, 'preflight', ['auth' => false]], // this is needed for CORS Requests ['GET', 'test', Example::class, 'test'], // The multi-level stuff 'firstlevel' => [ 'secondlevel' => [ ['OPTIONS', '', RestApiHelper::class, 'preflight', ['auth' => false]], ['POST', '', MyEndpoints::class, 'secondlevelHandler'] ] ] 'users' => [ ['OPTIONS', '', RestApiHelper::class, 'preflight', ['auth' => false]], // this is needed for CORS Requests ['GET', '', Example::class, 'getAllUsers', ["auth" => false]], ['GET', '{id:\d+}', Example::class, 'getUser', ["auth" => false]], // check: https://github.com/nikic/FastRoute ], ]; But, apparently that doesn't work. Anyone know how to do this?
×
×
  • Create New...