-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
60 lines (41 loc) · 1.24 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
require __DIR__."/vendor/autoload.php";
use CoffeeCode\Router\Router;
use thiagoalessio\TesseractOCR\TesseractOCR;
$router = new Router(URL_BASE);
// Controllers
$router->namespace("Source\App");
/*
* Rota padrão ao acessar sem parâmetros
*/
$router->group(null);
$router->get("/", "Error:padrao");
/*
* Rotas TRF1
*/
$router->group("trf1");
$router->get("/numProcesso/{params}/{numProc}", "Trf1:numProcesso");
$router->get("/cpf/{params}/{cpf}", "Trf1:cpf");
$router->get("/numProcOrigin/{num}", "Trf1:numProcOrigin");
/*
* Rotas TRF2
*/
$router->group("trf2");
$router->get("/{uf}/numProcesso/{numProc}", "Trf2:numProcesso");
$router->get("/{uf}/cpf/{cpf}", "Trf2:cpf");
/*
* Rotas TRF3
*/
$router->group("trf3");
$router->get("/numProcesso/{numProc}", "Trf3:numProcesso");
$router->get("/cpf/{cpf}", "Trf3:cpf");
/*
* Rotas Erros
*/
$router->group("oops");
$router->get("/{errcode}", "Error:error");
$router->dispatch();
if($router->error())
{
$router->redirect("/oops/{$router->error()}");
}