forked from alexjustesen/speedtest-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.php
More file actions
28 lines (24 loc) · 821 Bytes
/
api.php
File metadata and controls
28 lines (24 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
use App\Http\Controllers\Api\V0\GetLatestController;
use Illuminate\Support\Facades\Route;
/**
* Health check route to ensure the API is up and running.
*/
Route::get('/healthcheck', function () {
return response()->json([
'message' => 'Speedtest Tracker is running!',
]);
})->name('healthcheck');
/**
* This route provides backwards compatibility from https://github.com/henrywhitaker3/Speedtest-Tracker
* for Homepage and Organizr dashboards which expects the returned
* download and upload values in mbits.
*
* @deprecated
*/
Route::get('/speedtest/latest', GetLatestController::class)
->middleware('accept-json')
->name('speedtest.latest');
Route::middleware(['auth:sanctum', 'throttle:api', 'accept-json'])->group(function () {
require __DIR__.'/api/v1/routes.php';
});