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-08-13 01:58:37 +00:00
|
|
|
return [
|
|
|
|
'routes' => [
|
2022-10-29 18:09:38 +00:00
|
|
|
// Vue routes for deep links
|
2022-08-17 20:59:26 +00:00
|
|
|
['name' => 'page#main', 'url' => '/', 'verb' => 'GET'],
|
2022-10-29 18:09:38 +00:00
|
|
|
['name' => 'page#folder', 'url' => '/folders/{path}', 'verb' => 'GET', ...getWildcard('path')],
|
2022-09-12 03:06:28 +00:00
|
|
|
['name' => 'page#favorites', 'url' => '/favorites', 'verb' => 'GET'],
|
2022-09-13 07:55:32 +00:00
|
|
|
['name' => 'page#videos', 'url' => '/videos', 'verb' => 'GET'],
|
2022-10-29 18:09:38 +00:00
|
|
|
['name' => 'page#albums', 'url' => '/albums/{id}', 'verb' => 'GET', ...getWildcard('id')],
|
2022-09-25 23:02:26 +00:00
|
|
|
['name' => 'page#archive', 'url' => '/archive', 'verb' => 'GET'],
|
2022-10-06 20:20:29 +00:00
|
|
|
['name' => 'page#thisday', 'url' => '/thisday', 'verb' => 'GET'],
|
2022-10-29 18:09:38 +00:00
|
|
|
['name' => 'page#people', 'url' => '/people/{name}', 'verb' => 'GET', ...getWildcard('name')],
|
|
|
|
['name' => 'page#tags', 'url' => '/tags/{name}', 'verb' => 'GET', ...getWildcard('name')],
|
2022-08-13 03:34:05 +00:00
|
|
|
|
2022-10-29 00:25:39 +00:00
|
|
|
// Public pages
|
2022-10-29 18:05:05 +00:00
|
|
|
['name' => 'page#sharedfolder', 'url' => '/s/{token}', 'verb' => 'GET'],
|
2022-10-29 00:25:39 +00:00
|
|
|
|
2022-10-29 18:05:05 +00:00
|
|
|
// API Routes
|
|
|
|
['name' => 'days#days', 'url' => '/api/days', 'verb' => 'GET'],
|
|
|
|
['name' => 'days#day', 'url' => '/api/days/{id}', 'verb' => 'GET'],
|
2022-10-29 18:09:38 +00:00
|
|
|
['name' => 'days#dayPost', 'url' => '/api/days', 'verb' => 'POST'],
|
2022-10-26 22:12:46 +00:00
|
|
|
|
2022-10-29 18:05:05 +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-10-29 18:05:05 +00:00
|
|
|
['name' => 'albums#albums', 'url' => '/api/albums', 'verb' => 'GET'],
|
2022-10-26 22:12:46 +00:00
|
|
|
|
2022-10-29 18:05:05 +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-10-29 18:05:05 +00:00
|
|
|
['name' => 'image#info', 'url' => '/api/info/{id}', 'verb' => 'GET'],
|
|
|
|
['name' => 'image#edit', 'url' => '/api/edit/{id}', 'verb' => 'PATCH'],
|
|
|
|
|
|
|
|
['name' => 'archive#archive', 'url' => '/api/archive/{id}', 'verb' => 'PATCH'],
|
2022-08-20 00:18:04 +00:00
|
|
|
|
|
|
|
// Config API
|
2022-10-29 18:05:05 +00:00
|
|
|
['name' => 'other#setUserConfig', 'url' => '/api/config/{key}', 'verb' => 'PUT'],
|
2022-10-17 02:52:44 +00:00
|
|
|
|
|
|
|
// Service worker
|
2022-10-29 18:05:05 +00:00
|
|
|
['name' => 'other#serviceWorker', 'url' => '/service-worker.js', 'verb' => 'GET'],
|
2022-08-13 01:58:37 +00:00
|
|
|
]
|
|
|
|
];
|