Jump to content

lemgrago

Members
  • Posts

    1
  • Joined

  • Last visited

Recent Profile Visitors

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

lemgrago's Achievements

Starter

Starter (1/6)

0

Reputation

  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...