Projekt

Obecné

Profil

Stáhnout (1.34 KB) Statistiky
| Větev: | Revize:
1
<?php
2

    
3
/*
4
|--------------------------------------------------------------------------
5
| Application Routes
6
|--------------------------------------------------------------------------
7
|
8
| Here is where you can register all of the routes for an application.
9
| It is a breeze. Simply tell Lumen the URIs it should respond to
10
| and give it the Closure to call when that URI is requested.
11
|
12
*/
13

    
14
$apiUrlRoot='/api/v1/';
15

    
16
/**
17
 * Welcome endpoint.
18
 */
19
$app->get('/', function ()  {
20
    return 'Welcome.';
21
});
22

    
23
/**
24
 * Parametry v url:
25
 * address
26
 * showDirection
27
 */
28
$app->get($apiUrlRoot.'devices', [
29
    'middleware' => 'jwtauth',
30
    'uses' => 'DeviceController@getDevice'
31
]);
32

    
33

    
34
/**
35
 * Parametry v url:
36
 * dateFrom
37
 * dateTo
38
 * timeFrom
39
 * timeTo
40
 * direction
41
 */
42
$app->get($apiUrlRoot.'devices/{id}', [
43
    'middleware' => 'jwtauth',
44
    'uses' => 'DeviceController@getDeviceById'
45
]);
46

    
47

    
48
/**
49
 * Vrati vsechny typy aut.
50
 */
51
$app->get($apiUrlRoot.'vehicles', [
52
    'middleware' => 'jwtauth',
53
    'uses' => 'VehicleController@getAll'
54
]);
55

    
56
/**
57
 * Vrati vsechna mesta.
58
 */
59
$app->get($apiUrlRoot.'cities', [
60
    'middleware' => 'jwtauth',
61
    'uses' => 'LocationController@getCities'
62
]);
63

    
64
/**
65
 * Vygeneruje novy JWT s omezenou platnosti.
66
 */
67
$app->get($apiUrlRoot.'token', 'TokenController@generateToken');
68

    
69

    
70

    
71
// testovani
72
$app->get($apiUrlRoot.'header', 'DeviceController@headerTest');
    (1-1/1)