mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-21 13:23:04 +01:00
Added changelog API method
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
use Updater;
|
use Updater;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
@@ -58,4 +59,20 @@ class UpdateController extends Controller
|
|||||||
'success' => $cp,
|
'success' => $cp,
|
||||||
], 200);
|
], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function changelog()
|
||||||
|
{
|
||||||
|
$url = base_path() . '/changelog.json';
|
||||||
|
|
||||||
|
try {
|
||||||
|
$changelog = json_decode(file_get_contents($url), true);
|
||||||
|
} catch(Exception $e) {
|
||||||
|
$changelog = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'method' => 'get changelog',
|
||||||
|
'data' => $changelog
|
||||||
|
], 200);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ Route::group([
|
|||||||
'middleware' => 'api',
|
'middleware' => 'api',
|
||||||
'prefix' => 'update',
|
'prefix' => 'update',
|
||||||
], function () {
|
], function () {
|
||||||
|
Route::get('changelog', 'UpdateController@changelog')
|
||||||
|
->name('update.changelog');
|
||||||
Route::get('check', 'UpdateController@checkForUpdate')
|
Route::get('check', 'UpdateController@checkForUpdate')
|
||||||
->name('update.check');
|
->name('update.check');
|
||||||
Route::get('download', 'UpdateController@downloadUpdate')
|
Route::get('download', 'UpdateController@downloadUpdate')
|
||||||
|
|||||||
Reference in New Issue
Block a user