phpvms/app/Routes/api.php

41 lines
1.3 KiB
PHP
Raw Normal View History

2017-06-09 02:28:26 +08:00
<?php
/**
* public routes
*/
Route::group([], function()
{
2017-12-29 04:35:28 +08:00
Route::get('acars', 'AcarsController@index');
Route::get('airports/{id}', 'AirportController@get');
Route::get('airports/{id}/lookup', 'AirportController@lookup');
2017-12-29 04:35:28 +08:00
Route::get('flights/search', 'FlightController@search');
Route::get('flights/{id}', 'FlightController@get');
2017-12-29 04:35:28 +08:00
Route::get('pireps/{id}/acars', 'PirepController@acars_get');
Route::get('pireps/{id}/geojson', 'PirepController@acars_get');
2017-12-29 08:00:35 +08:00
Route::get('status', 'StatusController@status');
});
2017-08-15 12:36:49 +08:00
/**
* these need to be authenticated with a user's API key
*/
Route::group(['middleware' => ['api.auth']], function ()
{
2017-12-29 04:35:28 +08:00
Route::get('pireps/{id}', 'PirepController@get');
2017-12-29 04:35:28 +08:00
Route::post('pireps/prefile', 'PirepController@prefile');
Route::post('pireps/{id}/file', 'PirepController@file');
2018-01-04 00:25:55 +08:00
Route::post('pireps/{id}/cancel', 'PirepController@cancel');
2017-12-29 04:35:28 +08:00
Route::post('pireps/{id}/acars', 'PirepController@acars_store');
Route::post('pireps/{id}/acars/position', 'PirepController@acars_store');
Route::post('pireps/{id}/acars/log', 'PirepController@acars_log');
# This is the info of the user whose token is in use
2017-12-29 04:35:28 +08:00
Route::get('user', 'UserController@index');
Route::get('users/{id}', 'UserController@get');
Route::get('users/{id}/bids', 'UserController@bids');
2017-08-15 07:26:20 +08:00
});