2024-02-29 18:09:17 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Route;
|
2024-03-07 22:42:11 +01:00
|
|
|
use App\Http\Controllers\API\PageAPIController;
|
2024-03-11 23:32:38 +01:00
|
|
|
use App\Http\Controllers\API\FileUploadAPIController;
|
2024-03-19 22:34:01 +01:00
|
|
|
use App\Http\Controllers\API\SettingsAPIController;
|
2024-04-16 23:36:57 +02:00
|
|
|
use App\Http\Controllers\API\InitAPIController;
|
2024-06-05 21:33:11 +02:00
|
|
|
use App\Http\Controllers\API\MailAPIController;
|
2024-02-29 18:09:17 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| 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!
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2024-07-10 00:26:01 +02:00
|
|
|
//site setup
|
|
|
|
Route::post("/v1/init", [InitAPIController::class, 'setupFresh']);
|
|
|
|
Route::post("/v1/restore", [InitAPIController::class, 'setupRestore']);
|
|
|
|
|
2024-03-12 23:16:36 +01:00
|
|
|
//handle page editing actions
|
2024-07-24 01:46:45 +02:00
|
|
|
Route::group(['prefix' => '/admin/page', 'middleware' => 'validate.key'], function () {
|
2024-07-24 22:57:04 +02:00
|
|
|
Route::put("/update", [PageAPIController::class, 'update']);
|
2024-07-07 01:41:32 +02:00
|
|
|
Route::post("/create", [PageAPIController::class, 'create']);
|
|
|
|
Route::delete("/delete", [PageAPIController::class, 'delete']);
|
|
|
|
});
|
2024-07-07 00:23:23 +02:00
|
|
|
|
2024-03-19 22:34:01 +01:00
|
|
|
//settings
|
2024-07-18 00:41:11 +02:00
|
|
|
Route::group(['prefix' => '/v1/settings', 'middleware' => 'validate.key'], function () {
|
2024-07-07 01:41:32 +02:00
|
|
|
Route::put("/publish", [SettingsAPIController::class, 'publish']);
|
|
|
|
Route::put("/sync", [SettingsAPIController::class, 'sync']);
|
|
|
|
Route::put("/nav-sync", [SettingsAPIController::class, 'navSync']);
|
|
|
|
});
|
|
|
|
//backups
|
2024-07-18 00:41:11 +02:00
|
|
|
Route::group(['prefix' => '/v1/backup', 'middleware' => 'validate.key'], function () {
|
2024-07-07 01:41:32 +02:00
|
|
|
Route::put("/create", [SettingsAPIController::class, 'createBackup']);
|
|
|
|
Route::get("/content-download", [SettingsAPIController::class, 'downloadBackup']);
|
|
|
|
Route::get("/files-download", [SettingsAPIController::class, 'downloadBackup']);
|
|
|
|
});
|
2024-07-03 01:09:27 +02:00
|
|
|
|
2024-07-07 01:41:32 +02:00
|
|
|
//other
|
2024-07-18 00:41:11 +02:00
|
|
|
Route::group(['prefix' => '/v1', 'middleware' => 'validate.key'], function () {
|
2024-07-07 01:41:32 +02:00
|
|
|
Route::post("/files", [FileUploadAPIController::class, 'upload']);
|
|
|
|
Route::post("/reset", [InitAPIController::class, 'setupReset']);
|
|
|
|
Route::post("/mailer", [MailAPIController::class, 'sendNotify']);
|
|
|
|
});
|