Classe php para trabalhar REST API
Router::view("home.html");
Router::view("home.html", ["#{titulo}#" => "Bem vindo ao site"] );
Router::Jwt();
Se o jwt for inválido irá cortar o fluxo da aplicação e gerar um erro
Router::validateJwt();
Router::get('/', function(){
Router::view("home.html", ["#{titulo}#" => "Bem vindo ao site"] );
});
Router::get('/idUsuario/{cpf}', function($params){
echo $params->cpf;
});
Router::post('/dados', function(){
print_r($_POST);
});
Router::getJson();
Obrigatório Stringify
### Ex:
Router::post('/recebejson', function(){
$dados = Router::getJson();
echo $dados->nome;
});
Router::post('/dados', function(){
var_dump( Router::getJson() );
});
Router::put('/dados', function(){
var_dump( Router::getJson() );
});
Router::delete('/dados/{cod}', function($params){
echo $params->cod;
});
Router::get('/dados', function(){
Router::json( array("usuario" => "soriano") );
});
Router::dev();
Router::notFound("notFound.html");