Projekt

Obecné

Profil

Stáhnout (1.52 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
 * Vrati seznam mericich zarizeni.
25
 */
26
$app->get($apiUrlRoot.'devices', [
27
    'middleware' => 'jwtauth',
28
    'uses' => 'DeviceController@getDevice'
29
]);
30

    
31

    
32
/**
33
 * Vrati zaznamy o doprav e za casovy usek pro dane zarizeni.
34
 */
35
$app->get($apiUrlRoot.'devices/{id}', [
36
    'middleware' => 'jwtauth',
37
    'uses' => 'DeviceController@getDeviceById'
38
]);
39

    
40
/**
41
 * Vrati prumery dopravy pro danze zarizeni za casovy usek.
42
 */
43
$app->get($apiUrlRoot.'devices/{id}/time-period', [
44
   'middleware' => 'jwtauth',
45
    'uses' => 'DeviceController@getTrafficAverageByDevice'
46
]);
47

    
48

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

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

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

    
70

    
71

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