Skip to content

Commit

Permalink
Added OPTIONS http method
Browse files Browse the repository at this point in the history
  • Loading branch information
paveljanda committed Oct 12, 2016
1 parent a5c4c64 commit a1b3667
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions src/ApiRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,22 @@ class ApiRoute extends ApiRouteSpec implements IRouter
* @var array
*/
private $actions = [
'POST' => FALSE,
'GET' => FALSE,
'PUT' => FALSE,
'DELETE' => FALSE
'POST' => FALSE,
'GET' => FALSE,
'PUT' => FALSE,
'DELETE' => FALSE,
'OPTIONS' => FALSE
];

/**
* @var array
*/
private $default_actions = [
'POST' => 'create',
'GET' => 'read',
'PUT' => 'update',
'DELETE' => 'delete'
'POST' => 'create',
'GET' => 'read',
'PUT' => 'update',
'DELETE' => 'delete',
'OPTIONS' => 'options'
];

/**
Expand Down
2 changes: 1 addition & 1 deletion src/ApiRouteSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ abstract class ApiRouteSpec extends Nette\Object
protected $path = '/';

/**
* @Enum({"CREATE", "READ", "UPDATE", "DELETE"})
* @Enum({"CREATE", "READ", "UPDATE", "DELETE", "OPTIONS"})
* @var string
*/
protected $method;
Expand Down

0 comments on commit a1b3667

Please sign in to comment.