Ale Gallo
b91cf0cbde
committing part of the laravel system with templating files and api implementation.
32 lines
No EOL
2.1 KiB
PHP
32 lines
No EOL
2.1 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\RouteController;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| API Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here is where you can register API routes for your application. These
|
|
| routes are loaded by the RouteServiceProvider and all of them will
|
|
| be assigned to the "api" middleware group. Make something great!
|
|
|
|
|
*/
|
|
|
|
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
|
|
return $request->user();
|
|
});
|
|
|
|
Route::get('all-routes', [RouteController::class, 'getAllRoutes']); // this will return an array of [id, title, length, elevation_gain and possible sports] for each route
|
|
Route::get('route-categories', [RouteController::class, 'getRoutesCategories']); // this will return an array of [id, title, length, elevation_gain and possible sports] for each route
|
|
Route::get('route-by-category/{catId}', [RouteController::class, 'getRoutesByCategory']); // this will return an array of [id, title, length, elevation_gain and possible sports] for each route
|
|
|
|
Route::get('route/{id}', [RouteController::class, 'getSingleRoute']); // this will return details for all sports related to this route, including picture urls
|
|
Route::get('route/{id}/{sportId}', [RouteController::class, 'getSingleRouteDetails']); // this will return route's details for a single sport, including picture urls
|
|
Route::get('downloadGpx/{id}/{sportId}', [RouteController::class, 'downloadGpx']); // download the gpx file of a route given the route id and the chosen sport
|
|
Route::get('getPlacemarks/{id}/{sportId}', [RouteController::class, 'getPlacemarks']); // this will return the list of placemark for a specific sport on a specifi route
|
|
|
|
Route::get('getFeedbacks/{id}/{sportId}', [RouteController::class, 'getFeedbacks']); // get all feedbacks on a route given the route id and the chosen sport
|
|
Route::post('storeFeedback', [RouteController::class, 'storeFeedback']); // store feedback on a route given the route id and the chosen sport
|