Added changelog API method

This commit is contained in:
Henry Whitaker
2020-04-24 18:20:12 +01:00
parent dee74bb0c8
commit d160dcbd0b
2 changed files with 19 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use Exception;
use Updater;
use Illuminate\Http\Request;
@@ -58,4 +59,20 @@ class UpdateController extends Controller
'success' => $cp,
], 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);
}
}