Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 9bc023de

Přidáno uživatelem Cajova-Houba před téměř 7 roky(ů)

refs #6975: Cors middleware zmenen z globalniho na lokalni (kvuli stahovani), pridan endpoint pro stazeni dat ve formatu csv.

Zobrazit rozdíly:

backend/app/Http/routes.php
24 24
 * Vrati seznam mericich zarizeni.
25 25
 */
26 26
$app->get($apiUrlRoot.'devices', [
27
    'middleware' => 'jwtauth',
27
    'middleware' => ['cors', 'jwtauth'],
28 28
    'uses' => 'DeviceController@getDevice'
29 29
]);
30 30

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

  
40
$app->get($apiUrlRoot.'devices/{id}/csv', [
36 41
    'middleware' => 'jwtauth',
37
    'uses' => 'DeviceController@getDeviceById'
42
    'uses' => 'DeviceController@getDeviceByIdAsCsv'
38 43
]);
39 44

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

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

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

  

Také k dispozici: Unified diff