2022-08-13 01:58:37 +00:00
|
|
|
<?php
|
2022-10-29 18:09:38 +00:00
|
|
|
|
|
|
|
function getWildcard($param) {
|
|
|
|
return [
|
|
|
|
'requirements' => [ $param => '.*' ],
|
|
|
|
'defaults' => [ $param => '' ]
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2022-10-29 18:45:24 +00:00
|
|
|
function w($base, $param) {
|
|
|
|
return array_merge($base, getWildcard($param));
|
|
|
|
}
|
|
|
|
|
2022-08-13 01:58:37 +00:00
|
|
|
return [
|
|
|
|
'routes' => [
|
2022-10-29 18:09:38 +00:00
|
|
|
// Vue routes for deep links
|
2022-11-07 03:36:11 +00:00
|
|
|
['name' => 'Page#main', 'url' => '/', 'verb' => 'GET'],
|
|
|
|
['name' => 'Page#favorites', 'url' => '/favorites', 'verb' => 'GET'],
|
|
|
|
['name' => 'Page#videos', 'url' => '/videos', 'verb' => 'GET'],
|
|
|
|
['name' => 'Page#archive', 'url' => '/archive', 'verb' => 'GET'],
|
|
|
|
['name' => 'Page#thisday', 'url' => '/thisday', 'verb' => 'GET'],
|
2022-10-29 18:45:24 +00:00
|
|
|
|
|
|
|
// Routes with params
|
2022-11-07 03:36:11 +00:00
|
|
|
w(['name' => 'Page#folder', 'url' => '/folders/{path}', 'verb' => 'GET'], 'path'),
|
|
|
|
w(['name' => 'Page#albums', 'url' => '/albums/{id}', 'verb' => 'GET'], 'id'),
|
|
|
|
w(['name' => 'Page#people', 'url' => '/people/{name}', 'verb' => 'GET'], 'name'),
|
|
|
|
w(['name' => 'Page#tags', 'url' => '/tags/{name}', 'verb' => 'GET'], 'name'),
|
2022-08-13 03:34:05 +00:00
|
|
|
|
2022-11-07 03:36:11 +00:00
|
|
|
// Public folder share
|
|
|
|
['name' => 'Public#showShare', 'url' => '/s/{token}', 'verb' => 'GET'],
|
|
|
|
[
|
|
|
|
'name' => 'Public#showAuthenticate',
|
|
|
|
'url' => '/s/{token}/authenticate/{redirect}',
|
|
|
|
'verb' => 'GET',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => 'Public#authenticate',
|
|
|
|
'url' => '/s/{token}/authenticate/{redirect}',
|
|
|
|
'verb' => 'POST',
|
|
|
|
],
|
2022-10-29 00:25:39 +00:00
|
|
|
|
2022-10-29 18:05:05 +00:00
|
|
|
// API Routes
|
2022-11-07 03:36:11 +00:00
|
|
|
['name' => 'Days#days', 'url' => '/api/days', 'verb' => 'GET'],
|
|
|
|
['name' => 'Days#day', 'url' => '/api/days/{id}', 'verb' => 'GET'],
|
|
|
|
['name' => 'Days#dayPost', 'url' => '/api/days', 'verb' => 'POST'],
|
2022-10-26 22:12:46 +00:00
|
|
|
|
2022-11-07 03:36:11 +00:00
|
|
|
['name' => 'Tags#tags', 'url' => '/api/tags', 'verb' => 'GET'],
|
|
|
|
['name' => 'Tags#previews', 'url' => '/api/tag-previews', 'verb' => 'GET'],
|
2022-10-26 22:12:46 +00:00
|
|
|
|
2022-11-07 03:36:11 +00:00
|
|
|
['name' => 'Albums#albums', 'url' => '/api/albums', 'verb' => 'GET'],
|
2022-10-26 22:12:46 +00:00
|
|
|
|
2022-11-07 03:36:11 +00:00
|
|
|
['name' => 'Faces#faces', 'url' => '/api/faces', 'verb' => 'GET'],
|
|
|
|
['name' => 'Faces#preview', 'url' => '/api/faces/preview/{id}', 'verb' => 'GET'],
|
2022-10-26 22:12:46 +00:00
|
|
|
|
2022-12-03 05:04:31 +00:00
|
|
|
['name' => 'Image#preview', 'url' => '/api/image/preview/{id}', 'verb' => 'GET'],
|
2022-11-10 05:39:13 +00:00
|
|
|
['name' => 'Image#info', 'url' => '/api/image/info/{id}', 'verb' => 'GET'],
|
2022-11-10 06:19:44 +00:00
|
|
|
['name' => 'Image#setExif', 'url' => '/api/image/set-exif/{id}', 'verb' => 'PATCH'],
|
2022-11-10 06:43:58 +00:00
|
|
|
['name' => 'Image#jpeg', 'url' => '/api/image/jpeg/{id}', 'verb' => 'GET'],
|
2022-10-29 18:05:05 +00:00
|
|
|
|
2022-11-07 03:36:11 +00:00
|
|
|
['name' => 'Archive#archive', 'url' => '/api/archive/{id}', 'verb' => 'PATCH'],
|
2022-08-20 00:18:04 +00:00
|
|
|
|
2022-11-11 05:25:26 +00:00
|
|
|
['name' => 'Video#transcode', 'url' => '/api/video/transcode/{client}/{fileid}/{profile}', 'verb' => 'GET'],
|
2022-11-22 13:04:15 +00:00
|
|
|
['name' => 'Video#livephoto', 'url' => '/api/video/livephoto/{fileid}', 'verb' => 'GET'],
|
2022-11-09 04:08:30 +00:00
|
|
|
|
2022-08-20 00:18:04 +00:00
|
|
|
// Config API
|
2022-11-07 03:36:11 +00:00
|
|
|
['name' => 'Other#setUserConfig', 'url' => '/api/config/{key}', 'verb' => 'PUT'],
|
2022-10-17 02:52:44 +00:00
|
|
|
|
|
|
|
// Service worker
|
2022-11-07 03:36:11 +00:00
|
|
|
['name' => 'Other#serviceWorker', 'url' => '/service-worker.js', 'verb' => 'GET'],
|
2022-08-13 01:58:37 +00:00
|
|
|
]
|
|
|
|
];
|