Skip to content

Instantly share code, notes, and snippets.

@erandirjunior
Created November 5, 2018 23:45
Show Gist options
  • Save erandirjunior/f40d5329c41c30d03995d2b7557e4d01 to your computer and use it in GitHub Desktop.
Save erandirjunior/f40d5329c41c30d03995d2b7557e4d01 to your computer and use it in GitHub Desktop.
teste
require_once dirname(__DIR__).'/vendor/autoload.php';
use \PlugRoute\PlugRoute;
$route = new PlugRoute();
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE");
//header("Access-Control-Allow-Headers: PUT");
header("Access-Control-Allow-Headers: Content-Type");
$route->any('/', function ($request) {
var_dump($request->all());
});
$route->any('/teste/{something}', function ($request) {
var_dump($request->getUrlBody());
});
$route->on();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment